game loop improvement