fixed some potential problems with reversed motors and tidied up the code
added implementation for MotorTriple