           i += 3;
         }
         else
-            if (tmp_str[i + 1] == 'L' || tmp_str[i + 1] == 'l') { // create a LIDAR
+            if (tmp_str[i + 1] == 'L' || tmp_str[i + 1] == 'l') { // creates a LIDAR
             
-            int num_consumed = 0;
+              int num_consumed = 0;
               int _dir_pin, _step_pin, _enable_pin, _infrared_pin;
-              sscanf(tmp_str + i, "%d%d%d%d%n", &_dir_pin, &_step_pin, &_enable_pin, &_infrared_pin, &num_consumed);
-			  tera_ranger_one_lidar = new t_tera_ranger_one_lidar(_dir_pin, _step_pin, _enable_pin, _infrared_pin);
-			  //tera_ranger_one_lidar.set_pins(_dir_pin, _step_pin, _enable_pin, _infrared_pin);
-              
+              sscanf(tmp_str + i + 2, "%d%d%d%d%n", &_dir_pin, &_step_pin, &_enable_pin, &_infrared_pin, &num_consumed);
+			        tera_ranger_one_lidar = new t_tera_ranger_one_lidar(_dir_pin, _step_pin, _enable_pin, _infrared_pin);              
          
-			  //tera_ranger_one_lidar.disable_all();
-            sprintf(tmp_serial_out, "CL#");
-            strcat(serial_out, tmp_serial_out);
-            i += num_consumed;
-        }
-        else
-          i++; // incomplete string
+              sprintf(tmp_serial_out, "CL#");
+              strcat(serial_out, tmp_serial_out);
+              i += num_consumed + 2;
+            }
+            else
+              i++; // incomplete string
         continue;
       }
       else

      }

      // sets something
      if (tmp_str[i] == 'S' || tmp_str[i] == 's') {
        if (tmp_str[i + 1] == 'S' || tmp_str[i + 1] == 's') { // stepper motor speed and acceleration
          int motor_index;
          int motor_speed, motor_acceleration;
          sscanf(tmp_str + i + 2, "%d%d%d", &motor_index, &motor_speed, &motor_acceleration);
          stepper_motors_controller.set_speed_and_acceleration(motor_index, motor_speed, motor_acceleration);
          i += 5;
        }
        else if (tmp_str[i + 1] == 'P' || tmp_str[i + 1] == 'p') { // potentiometer min max home
          int pot_index, pot_min, pot_max, pot_home, pot_pin, pot_dir;
          sscanf(tmp_str + i + 2, "%d%d%d%d%d%d", &pot_index, &pot_pin, &pot_min, &pot_max, &pot_home, &pot_dir);

    // can be more than 1 command in a string, so I have to check again for a letter
    if ((tmp_str[i] >= 'A' && tmp_str[i] <= 'Z') || (tmp_str[i] >= 'a' && tmp_str[i] <= 'z')) {

		if (tmp_str[i] == 'S' || tmp_str[i] == 's') { // stepper motor
			if (tmp_str[i + 1] == 'M' || tmp_str[i + 1] == 'm') { // move motor
				int motor_index, num_steps;
       int num_consumed;
				int num_read = sscanf(tmp_str + i + 2, "%d%d%n", &motor_index, &num_steps, &num_consumed);
				if (num_read == 2) {
					stepper_motors_controller.move_motor(motor_index, num_steps);
					is_command_running = 1;
					i += 2 + num_consumed;
				}
				else
					i++;// error on incomplete string (does nothing)
			}
			else
			if (tmp_str[i + 1] == 'D' || tmp_str[i + 1] == 'd') { // disable motor
				int motor_index;
					sscanf(tmp_str + i + 2, "%d", &motor_index);
					stepper_motors_controller.disable(motor_index);
					sprintf(tmp_serial_out, "SD%d#", motor_index);
					strcat(serial_out, tmp_serial_out);
					i += 4;
			}
			// locks motor
			else
			if (tmp_str[i + 1] == 'L' || tmp_str[i + 1] == 'l') {
				int motor_index;
				sscanf(tmp_str + i + 2, "%d", &motor_index);
				stepper_motors_controller.lock(motor_index);
				sprintf(tmp_serial_out, "SL%d#", motor_index);
				strcat(serial_out, tmp_serial_out);
				i += 4;
			}
     else
        if (tmp_str[i + 1] == 'S' || tmp_str[i + 1] == 's') { // stepper motor speed and acceleration
          int motor_index;
          int motor_speed, motor_acceleration;
          int num_consumed;
          sscanf(tmp_str + i + 2, "%d%d%d%n", &motor_index, &motor_speed, &motor_acceleration, &num_consumed);
          stepper_motors_controller.set_speed_and_acceleration(motor_index, motor_speed, motor_acceleration);
          i += 2 + num_consumed;
        }
			else
				i++;
			continue;
		}

        // dc motor
		if (tmp_str[i + 1] == 'D' || tmp_str[i + 1] == 'd') { // DC motor
			if (tmp_str[i + 1] == 'M' || tmp_str[i + 1] == 'm') { // 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);
