 String theMessage = "";
 char theChar = 0;
 
-int xBuffer[4];
-int yBuffer[4];
+int xBuffer[5];
+int yBuffer[5];
 int bufferVal = 0;
 int xDir;
 int yDir;
+int buttonVal;
 
 void setup(void)
 {
-  Serial.begin(115200);
+  //Serial.begin(115200);
   radio.begin();
   radio.openReadingPipe(1,pipe);
   radio.startListening();

      analogWrite(r1_motor, xDir);
      analogWrite(r2_motor, 0);
    }
    else if(xDir < -10)
    {
      analogWrite(l2_motor, abs(xDir));
      analogWrite(l1_motor, abs(0));

    char charBuf[length];
    
    theMessage.substring(0,delimiter).toCharArray(charBuf,length);
    buttonVal = atof(charBuf);
    
    theMessage.substring(delimiter+1, delimiter2).toCharArray(charBuf,length);
    xBuffer[bufferVal] = (int)atof(charBuf);
    //Serial.print(xBuffer[bufferVal]); Serial.print('\t');
    

    theMessage.substring(delimiter2+1, theMessage.length()).toCharArray(charBuf,length);
    yBuffer[bufferVal] = (int)atof(charBuf);
    if (xBuffer[bufferVal] <= 1023 && xBuffer[bufferVal] >= 0 && yBuffer[bufferVal] <= 1023 && yBuffer[bufferVal] >= 0)
    {
      bufferVal = bufferVal + 1;
    }
   }
  else 
  {
    bufferVal = 0;
    xDir = (xBuffer[0] + xBuffer[1] + xBuffer[2] + xBuffer[3] + xBuffer[4])/5;
    //Serial.print(xDir); Serial.print('\t');
    yDir = (yBuffer[0] + yBuffer[1] + yBuffer[2] + yBuffer[3] + yBuffer[4])/5;
    if (xDir <= 1023 && yDir <= 1023)
    {
      xDir = map(xDir, 0, 1023, -255, 255);
      //Serial.println(xDir);
      yDir = map(yDir, 0, 1023, -255, 255);
    }
  }


    


    if(xDir > 50)
    {
      analogWrite(l1_motor, xDir);
      analogWrite(l2_motor, 0);
