Changed main game loop.