   //use this to move servos left and right
   moveLeft(resL);
   moveRight(resR);
+  Serial.println(resL);
+  //Serial.println(resR);
 
 
   delay(100);//let move for some time then stop
+  stopRedbot();
+  delay(10);
   //train
   brainL.train(eval(l, c, r), resL);
   brainR.train(eval(r, c, l), resR);
 
-
+ //}
 }
 
 
 //***** sensor function******
 
 int eval(int l, int c, int r) {
-   if((l > LINETHRESHOLD) && (c > LINETHRESHOLD) && (r > LINETHRESHOLD) )
+   if ((l > LINETHRESHOLD) && (c > LINETHRESHOLD) && (r > LINETHRESHOLD) )
 	{
             return 1;
 	}


void setup()
{
  randomSeed(analogRead(A3));
  brainL.randomize();
  brainR.randomize();
  Serial.begin(9600);

}


{


 
// if(Serial.available())
 //{
  //Serial.println("Goodnight moon!");
  int l = left.read();
  int r = right.read();
  int c = center.read();
  //set inputs
  brainL.inputs[0] = l;
  brainR.inputs[1] = c;
  brainL.inputs[2] = r;
  brainR.inputs[0] = l;
  brainR.inputs[1] = c;
  brainR.inputs[2] = r;

  //feed forward and calculate weighted sum
  int resL = brainL.feedForward();
