randomMove and main loop