added the game loop