$position in your last loop is incorrect. You should set it to the size of the word array before the loop, and decrement it inside that loop. Also, you are adding the numbers to the original word array. Use a second one.
pritaeas
Posting Prodigy
9,313 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,465
Skill Endorsements: 86