     if(abs(event.gyro.z) < MIN_ROLL_THRESHOLD)
     {
       digitalWrite(homePin, HIGH);
+      servoHomePin = true;
     }
     else if(event.gyro.z > 0)
       {
       digitalWrite(homePin, LOW);
+      servoHomePin = false;
       digitalWrite(statePin, LOW);
       finState = false;
       }
     else if(event.gyro.z < 0)
       {
       digitalWrite(homePin, LOW);
+      servoHomePin = false;
       digitalWrite(statePin, HIGH);
       finState = true;
       }

  gyro.getEvent(&mainEvent);
  accel.getEvent(&mainEvent); // Assume Z-axis is vertical for accel/gyro?
  bmp.getEvent(&mainEvent);
  char c = GPS.read(); //Must call GPS.read() at some point for data transmission to occur

  if(startTime != 0)

  timeData[0] = millis();
  timeData[1] = millis() - startTime;

if(!gpsOnFlag) {
  dataFlag = true; //If the GPS isn't on yet, set the dataFlag to true automatically
}
  

if(GPS.newNMEAreceived() && gpsOnFlag) { //Update GPS data if an update is available
  if (!GPS.parse(GPS.lastNMEA())) // this sets the newNMEAreceived() flag to false; prevents double(+)-update loop
      return;
      dataFlag = true; //Set flag to tell radio new data is ready
gpsLatitude = GPS.latitude;
gpsLongitude = GPS.longitude;
gpsAltitude = GPS.altitude;
