coMBINING ARDUINO SKETCHES

Every thing is okay except line follow command ,,,when i say line follow it only goes forward but does not follow line

my code is

String voice;
int LS=10;
int RS=9;
int LED=13;
char getstr;
int in1=3;
int in2=4;
int in3=5;
int in4=6;
int ENA=2;
int ENB=7;
long duration, distance;
int trigPin=A0;
int echoPin=A1;
int buzzer=8;

void forward()
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(in1,HIGH);
  digitalWrite(in2,LOW);
  digitalWrite(in3,LOW);
  digitalWrite(in4,HIGH);
 
}

void back()
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(in1,LOW);
  digitalWrite(in2,HIGH);
  digitalWrite(in3,HIGH);
  digitalWrite(in4,LOW);
 
}
void left()
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(in1,LOW);
  digitalWrite(in2,HIGH);
  digitalWrite(in3,LOW);
  digitalWrite(in4,HIGH);
 
}
void right()
{
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(in1,HIGH);
  digitalWrite(in2,LOW);
  digitalWrite(in3,HIGH);
  digitalWrite(in4,LOW);
 
}
void stop()
{
  digitalWrite(ENA,LOW);
  digitalWrite(ENB,LOW);
 
}
void on()
{
  digitalWrite(LED,HIGH);
}
void off()
{
  digitalWrite(LED,LOW);
}
void line(){

if(digitalRead(LS) && digitalRead(RS))     // Stop
  {
stop();
  }
 
  if(!(digitalRead(LS)) && digitalRead(RS))     // right
  {
right();
  }
 
  if(digitalRead(LS) && !(digitalRead(RS)))     // Turn left
  {
left();
  }
 
  if(!(digitalRead(LS)) && !(digitalRead(RS)))     // Forward
  {
    forward();
  }
}
void setup()
{
  pinMode(LED, OUTPUT);
  Serial.begin(9600);
pinMode(LS, INPUT);
  pinMode(RS, INPUT);
  pinMode(in1,OUTPUT);
  pinMode(in2,OUTPUT);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
  pinMode(in3,OUTPUT);
  pinMode(in4,OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(ENB,OUTPUT);
pinMode(buzzer, OUTPUT);
}
void loop()
{
  while (Serial.available()){ //Check if there is an available byte to read
     delay(10); //Delay added to make thing stable
    char c = Serial.read(); //Conduct a serial read
    if (c == '#') {break;} //Exit the loop when the # is detected after the word
    voice += c; //Shorthand for voice = voice + c
  }
  if (voice.length() > 0){
    if(voice == "*go ahead"){
      forward();
      }
    else if(voice == "*go back"){
      back();
      }
    else if(voice == "*turn right") {
      right();
    }
    else if(voice == "*turn left") {
      left();
    }
    else if(voice == "*light on") {
      on();
    }
    else if(voice == "*light off") {
      off();
    }
   
    else if(voice == "*stop") {
      stop();
    }
else if(voice == "*line follow") {
line();
     
    }

   
  voice=""; //Reset the variable after initiating
  }
}

And why is this a bug affecting this website?