added motor code
cleaned up code