fixed the gameloop, added pause