 //      else{}
   }
   // if the left sensor is the only sensor that have the value 1, the bot need to compensate by turning left
-  else if((leftSensor == 1 && middleSensor == 0 && rightSensor == 0) || (leftSensor == 1 && middleSensor == 1 && rightSensor == 0)) 
+  else if((leftSensor == 0 && middleSensor == 0 && rightSensor == 1) || (leftSensor == 0 && middleSensor == 1 && rightSensor == 1))
   {
-      Motors.runMotor(1,BACKWARD,0);
       Motors.runMotor(2,FORWARD,(turnMulti*speedVal));
+      Motors.runMotor(1,FORWARD,0);
       //remove delay
       delay(delVal);
       //if((leftSensor == 0 && middleSensor == 0 && rightSensor == 0) || (leftSensor == 1 && middleSensor == 1 && rightSensor == 1))

//int turnSpeed = 60;

// Variable that works as a factor regulating the turn speed. i.e 1.8*spedVal = turnspeed
float turnMulti = 1.8;

myMotors Motors;   // Create Motors object
mySensors Sensors; // Create Sensors object

void setup() {
  Serial.begin(9600); // set up Serial connection at 9600 bps
    
  Motors.beginMotors();   // Start motors
  Sensors.beginSensors(); // Start sensors


      else
      {
        Motors.runMotor(1,FORWARD,speedVal);
        Motors.runMotor(2,FORWARD,speedVal);
      }
      //remove delay
      delay(delVal);
