game loop modified