Some beautification added to the main game loop.