public void trackLine()
  {  	
	  while(true){
	  	float gain = 0.5f; //gain to smooth the control 
        int error = CLDistance(lval, rval);
       //pilot.travel(200, true); //start the robot going forward
        lval = leftEye.getLightValue();
        rval = rightEye.getLightValue();
        control=lval-rval;
        pilot.steer(control*gain);         
        if((lval<-5 || rval<-5) && (rval2 > -8 && lval2 > -8)){//When it encounters black marker
        pilot.travel(6.5);
      	Sound.beep();
      	return;
        }
        lval2 = lval;
        rval2 = rval;
	  }
  }