   prevZ = gyroZ;
 }
 
-
+// Records the data and processes it
 void recordGyroData() {
-  Wire.beginTransmission(0b1101000); //I2C address of the MPU
-  Wire.write(0x43); //Starting register for Gyro Readings
+  Wire.beginTransmission(0b1101000);  //I2C address of the MPU
+  Wire.write(0x43);                   //Starting register for Gyro Readings
   Wire.endTransmission();
-  Wire.requestFrom(0b1101000,6); //Request Gyro Registers (43 - 48)
+  Wire.requestFrom(0b1101000,6);      //Request Gyro Registers (43 - 48)
   //while(Wire.available() < 6);
   gyroX = Wire.read()<<8|Wire.read(); //Store first two bytes into accelX
   gyroY = Wire.read()<<8|Wire.read(); //Store middle two bytes into accelY


  // Set up MPU
  setupMPU();
  Serial.write("setupped");
  // Calibrate sensors
  calibrateMPU();
  Serial.write("calibrated");
  // Begin Serial
  //Serial.begin(9600);

  // Write default values to the servos
  throttle.write(pos1);

void loop() {
  // Get information from the sensors
  recordGyroData();

  //Serial.write("processed");
  if(prevX - rotX > 5 || prevX - rotX < -5 || prevY - rotY > 5 || prevY - rotY < -5 || prevZ - rotZ > 5 || prevZ - rotZ < -5)
  {
