Cleaned up gameloop