3 Xbees Sync.  *HELP*

Hi there. I'm having a problem syncing my data properly when sending the information from the Xbees.

The setup is as follows.

4 xbee radios. Version1.1
4 Xbee shields, Libellium.
3 accelerometers.

the idea is to send the accelerometer data from 3 of the xbees to one xbe(connected to the computer). The information is then sent to max msp where sound and video synthesis takes place.

The problem is that sometimes the information gets muddled and a huge jump in the numbers occurs in max msp which i need to avoid.

Any help would be greatly appreciated.

Send code. (note the code has been modified from an existing and different sketch) Also accelerometer b and c have the board number variable set to 1 and 2 making their sync char B and C.

// accelerometer A

int count = 0;
int time = 0;
long randNumber = 0;
int separator = ',';
int maxDigital = 3;
int maxAnalog = 3;

// board number helps to distinguish each board
// CHANGE THIS NUMBER FOR EACH BOARD
int boardNumber = 0;  

void setup() {
  // the speed has to be 19200 to support 
  // wireless reprogramming
  Serial.begin(9600);  
}

void loop() {
  // we are going to use 10 different objects
  // in the simulation, that will be named: A, B, C ...
  time = millis();
  randomSeed(time);
  Serial.print(65 + boardNumber, BYTE);
//  Serial.print(separator, BYTE);
  /*
  for (count = 0; count <= maxDigital - 1; count++) {
    randNumber = random(2) + 48;
    Serial.print(randNumber, BYTE);
    Serial.print(separator, BYTE);
  } 
  */
  for (count = 0; count <= maxAnalog - 1; count++) {
    randNumber = analogRead(count);
    Serial.print(randNumber,BYTE);
    if (count < maxAnalog - 1) {
     // Serial.print(separator, BYTE);
    }
  } 
  Serial.println();
  delay(50);
}

Here is the receiver code.

int incomingByte;      // a variable to read incoming serial data into
int aX,aY,aZ,bX,bY,bZ,cX,cY,cZ ;
void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // see if there's incoming serial data:
  if (Serial.available() > 2) {
    // read the oldest byte in the serial buffer:
    incomingByte = Serial.read();
    if (incomingByte == 'A'){
       while (Serial.available() == 0);
       aX = Serial.read();
       while (Serial.available() == 0);
       aY = Serial.read();
       while (Serial.available() == 0);
       aZ = Serial.read();
    }
     if (incomingByte == 'B'){
    //  Serial.println("wooop");
       while (Serial.available() == 0);
       bX = Serial.read();
       while (Serial.available() == 0);
       bY = Serial.read();
       while (Serial.available() == 0);
       bZ = Serial.read();
       
       

    }
   
  
   
   if (incomingByte == 'C'){
    //  Serial.println("wooop");
       while (Serial.available() == 0);
       cX = Serial.read();
       while (Serial.available() == 0);
       cY = Serial.read();
       while (Serial.available() == 0);
       cZ = Serial.read();
       
       

    }
   
   
   // Serial.println(incomingByte>> 7,BYTE);
       // Serial.println(incomingByte % 128,BYTE);
                //          Serial.println(incomingByte,BYTE);
                  //       Serial.println(255,BYTE); this and 1 above works. 
    // if it's a capital H (ASCII 72), turn on the LED:
  /*  if (incomingByte == 10) {
      digitalWrite(ledPin, HIGH);
      Serial.println(10);
    } 
    // if it's an L (ASCII 76) turn off the LED:
    if (incomingByte == 10) {
      digitalWrite(ledPin, LOW);
            Serial.println(10);
    }*/
  }
  
 //  Serial.print("Accelerometer A = ");  
    Serial.print(aX,BYTE);
   // Serial.print(",");
    Serial.print(aY,BYTE);
    //Serial.print(",");
    Serial.print(aZ,BYTE);
   //Serial.print(" ");
   
   
    //Serial.print("Accelerometer B = ");  
    Serial.print(bX,BYTE);
    //Serial.print(",");
    Serial.print(bY,BYTE);
   // Serial.print(",");
    Serial.print(bZ,BYTE);
   //Serial.print(" ");
   
   
    //Serial.print("Accelerometer C = "); 


    Serial.print(cX,BYTE);
   // Serial.print(",");
    Serial.print(cY,BYTE);
   // Serial.print(",");
    Serial.print(cZ,BYTE);
   //Serial.print(" ");
   // Serial.println(" ");
   
   Serial.print(255,BYTE);
}

I suppose the main question is whether this is a reliable way of sending serial data over the Xbees and synchronizing it to be printed in order. any other little methods would really help me at this stage.

Thanks.

I do not mean to be annoying the forum by bumping this post but I really need some assistance with this as soon as possible, and am hoping somebody will come across it on the first page.