add motor control code