update to motor.cpp