                 Serial.write("current command is=");
                 Serial.write(tmp_str);
               #endif
-              
-              int motor_index, num_steps;
-              sscanf(tmp_str, "%d%d", &motor_index, &num_steps);
-              move_motor(motor_index, num_steps);
-              is_command_running = 1;
 
+              if (current_buffer[i] == 'M' || current_buffer[i] == 'm'){// moves motor
+                int motor_index, num_steps;
+                sscanf(tmp_str, "%d%d", &motor_index, &num_steps);
+                move_motor(motor_index, num_steps);
+                is_command_running = 1;
+              }
+              else
+                if (current_buffer[i] == 'D' || current_buffer[i] == 'd'){// disables motor
+                  int motor_index;
+                  sscanf(tmp_str, "%d", &motor_index);
+                  disable_motor(motor_index);
+                }
+                else
+                  if (current_buffer[i] == 'L' || current_buffer[i] == 'l'){// locks motor
+                    int motor_index;
+                    sscanf(tmp_str, "%d", &motor_index);
+                    lock_motor(motor_index);
+                  }
+                  else{
+                    // unknowm command
+                  }
               // remove the current executed command
               strcpy(current_buffer, current_buffer + j + 1);// not sure if this is good
               

      // parse from the beginning until I find a M, D, S or A
      int buffer_length = strlen(current_buffer);
      for (int i = 0; i < buffer_length; i++)
        if (current_buffer[i] == 'M'){// move motor
          // find the terminal character #
          int j = i + 1;
          for (; j < buffer_length && current_buffer[j] != '#'; j++);// parse until I find the termination char

            break; // for i
          }
        }
    }
  }
  
