Clean up of output and main game loop.