added motor algorithms