Changed to using NUM_MOTORS instead of the constant 3.