Updated the motor code