ARDUINO LINE FOLLOWING ROBOT

so making a line following robot need help problem is when i add calibration the robot moves side to side alot?

#define sensorLeft 0
#define sensorRight 1
#define pwmr 11
#define pwml 10
#define right1 5
#define right0 6
#define left1 3
#define left0 4

int difference = 0;

int sensorValLeft = 0;
int sensorMinLeft = 1023;
int sensorMaxLeft = 0;

int sensorValRight = 0;
int sensorMinRight = 1023;
int sensorMaxRight = 0;
int ldrrval;
int ldrlval;
int diffldrl;
int diffldrr;



//Motor setup
void setup()
{
    pinMode(sensorLeft, INPUT);
    pinMode(sensorRight, INPUT);
    pinMode(pwml, OUTPUT);//Pins on the Arduino
    pinMode(pwmr, OUTPUT);
    pinMode(right1, OUTPUT);
    pinMode(right0, OUTPUT);
    pinMode(left1, OUTPUT);
    pinMode(left0, OUTPUT);

//Calibration for both sensors in first 5 seconds
while(millis() < 5000)
{
    sensorValLeft = analogRead(sensorLeft);
    sensorValRight = analogRead(sensorRight);
    //Records the maximum sensor value for the left
    if(sensorValLeft > sensorMaxLeft)
    {
        sensorMaxLeft = sensorValLeft;
    }
    //Records the maximum sensor value for the right
    if(sensorValRight > sensorMaxRight)
    {
        sensorMaxRight = sensorValRight;
    }
    //Records the minimum sensor value for the left
    if(sensorValLeft < sensorMinLeft)
    {
        sensorMinLeft = sensorValLeft;
    }
    //Records the minimum sensor value for the right
    if(sensorValRight < sensorMinRight)
    {
        sensorMinRight = sensorValRight;
    }
    Serial.begin(9600);
} 
}

void forward()
{
         analogWrite(pwmr,100);
       analogWrite(pwml,100);
       digitalWrite(right1,HIGH);
       digitalWrite(right0,LOW);
       digitalWrite(left1,LOW);
       digitalWrite(left0,HIGH);
}



void stop1()
  {
      analogWrite(pwmr,100);
       analogWrite(pwml,100);
       digitalWrite(right1,LOW);
       digitalWrite(right0,LOW);
       digitalWrite(left1,LOW);
       digitalWrite(left0,LOW);
  }
  
 void right()
 {
    analogWrite(pwmr,100);//(Output, Power for Motor)
       analogWrite(pwml,30);
       digitalWrite(right1,HIGH);
       digitalWrite(right0,LOW);
       digitalWrite(left1,LOW);
       digitalWrite(left0,HIGH);
 }
 
 void left()
 {
   analogWrite(pwmr,30);
         analogWrite(pwml,100);
         digitalWrite(right1,HIGH);
         digitalWrite(right0,LOW);
         digitalWrite(left1,LOW);
         digitalWrite(left0,HIGH);
 }
void loop()
{
    //Reads the light sensors
    ldrlval = analogRead(sensorLeft);
    ldrrval = analogRead(sensorRight);
     diffldrl= sensorValLeft-ldrlval;
     diffldrr =sensorValRight-ldrrval;
    difference = diffldrl -diffldrr;
   
  
   if(difference > -10 && difference < 10)
   {
       forward();
   }
   
    
   else if (difference > 10)
   {
      right();
      delay(1);
      stop1();
  
   }
    
  
    else if (difference < -10)
    {
         left();
         delay(1);
         stop1();
    }
  
  else if (difference<-10 && difference>10)
  
  {
    forward();
   
  }
}
  else if (difference<-10 && difference>10)

If the value is less than -10 AND greater than 10, go forward. How many values are simultaneously less than -10 and greater than 10?

Where are your Serial.print() statements?

Why is the last value read from the left and right sensors in setup() important? Is the robot holding perfectly still for the 5 seconds after reset?

   if(difference > -10 && difference < 10)
...
   else if (difference > 10)

What if difference is exactly 10?