Working motor code