Improved the Game loop