added motor code