Changing the loop to randomize it

Changing the loop to randomize it