fixed the loops for the game