     if ((tmp_str[i] >= 'A' && tmp_str[i] <= 'Z') || (tmp_str[i] >= 'a' && tmp_str[i] <= 'z')){
       
       if (tmp_str[i] == 'M' || tmp_str[i] == 'm'){// moves motor
-        int motor_index, num_steps;
-        int num_read = sscanf(tmp_str + i + 1, "%d%d", &motor_index, &num_steps);
-        if (num_read == 2){
-          stepper_motors_controller.move_motor(motor_index, num_steps);
-          is_command_running = 1;
-          i += 4;
+        if (tmp_str[i + 1] == 'S' || tmp_str[i + 1] == 's'){// stepper motor
+          int motor_index, num_steps;
+          int num_read = sscanf(tmp_str + i + 2, "%d%d", &motor_index, &num_steps);
+          if (num_read == 2){
+            stepper_motors_controller.move_motor(motor_index, num_steps);
+            is_command_running = 1;
+            i += 5;
+          }
+          else
+            i++;// error on incomplete string (does nothing)
         }
         else
-          i++;// error on incomplete string (does nothing)
+          if (tmp_str[i + 1] == 'D' || tmp_str[i + 1] == 'd'){// stepper motor
+            int motor_index, num_miliseconds;
+            int num_read = sscanf(tmp_str + i + 2, "%d%d", &motor_index, &num_miliseconds);
+            if (num_read == 2){
+              dc_motors_controller_TB6612FNG.move_motor(motor_index, num_miliseconds);
+              is_command_running = 1;
+              i += 5;
+            }
+            else
+              i++;// error on incomplete string (does nothing)
+        }  
       }
       else
           if (tmp_str[i] == 'P' || tmp_str[i] == 'p'){// potentiometer            

#include "button_controller.h"
#include "jenny5_types.h"
#include "infrared_sensors_controller.h"
//#include "MemoryFree.h"

t_stepper_motors_controller stepper_motors_controller;
t_potentiometers_controller potentiometers_controller;
t_ultrasonic_sensors_controller ultrasonic_sensors_controller;
t_infrared_sensors_controller infrared_sensors_controller;

        else
        if (tmp_str[i] == 'D' || tmp_str[i] == 'd'){// disables motor
          int motor_index;
          if (tmp_str[i + 1] == 'S' || tmp_str[i + 1] == 's'){// disables stepper motor
            sscanf(tmp_str + i + 2, "%d", &motor_index);
            stepper_motors_controller.disable_motor(motor_index);
            sprintf(serial_out, "DS%d#", motor_index);
          }
          else
            if (tmp_str[i + 1] == 'D' || tmp_str[i + 1] == 'd'){// disables DC motor
              sscanf(tmp_str + i + 2, "%d", &motor_index);
              dc_motors_controller_TB6612FNG.disable(motor_index);
              sprintf(serial_out, "DD%d#", motor_index);            
            }
          i += 4;
        }
        else
          if (tmp_str[i] == 'L' || tmp_str[i] == 'l'){// locks motor
