moved the movement controller to main loop so it doesn't block