improving game loop