Added some more flexibility to motor types (still needs fixing)