Updated main game loop