       radio.read(msg, 1);
       theChar = msg[0];
     }
-  if(bufferVal <= 4)
-  {
+
+   if (bufferVal <= 4)
+   {
     int delimiter = theMessage.indexOf(',');
     
     

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

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



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

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