added turning funcitons to motor code