Make motor.update function