Fixed random choices

Under the choosePos function, using the rand command would not work, so changed iteration techniques and fixed it. Inefficient, can be changed at a later date.