worked on main loop, watchdog and motor