 
 void loop()
 {
-  gpsSerial.listen(); //switch to GPS serial
-  delayMicroseconds(150);
-  while (gpsSerial.available()) {
-    char c = GPS.read();
-  // if you want to debug, this is a good time to do it!
-  if ((c))
-    Serial.write(c); 
-  }
-  
-  XBee.listen();
+  #ifdef rawGPSDebug
+    while (gpsSerial.available()) {
+      char c = GPS.read();
+      if (c) {
+        Serial.write(c);
+      } 
+    }
+  #endif
   
   // if a sentence is received, we can check the checksum, parse it...
   if (GPS.newNMEAreceived()) {

      return;  // we can fail to parse a sentence in which case we should just wait for another
  }
 
     if (XBee.available()) {
      byte receivedPayload = XBee.read();
      switch (receivedPayload) {
        case FLAG_PAYLOAD:
          digitalWrite(PIN_PAYLOAD,HIGH);
          break;
        default:
          digitalWrite(PIN_PAYLOAD,LOW);
          break;
      }
      #ifdef readDebug
        Serial.print("size: ");
        Serial.println(XBee.available());
        Serial.println(receivedPayload, HEX);
      #endif
    }
  // if millis() or timer wraps around, reset
  if (timer > millis())  timer = millis();
  if (millis() - timer > 400) {

{
  pinMode(PIN_PAYLOAD, OUTPUT);
  
  //Make sure Serial baud matches hardware config
  Serial1.begin(57600); //XBee baud rate
  Serial.begin(115200);

  // 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
