 // ================ SYSTEM PARAMETERS ===================
 // Sample rates
 int motorUpdateRate = 50; // gyro sample rate
-int calibrationSamples = 1000;
+int calibrationSamples = 500;
 
 // Initial calibration value
 float calibratedOffset = 0;

  // Update motor position
  if(update_flag) {
    // Update stepper position (Z/AZM)
    float degreesActuallyCorrected = rotateStepperBy(positionChange);
    positionChange -= degreesActuallyCorrected;
    // Reset flag
    update_flag = false;
  }


  // Accept corrections from serial
  if (Serial.available() == 4) {
    float correctionFactor = 0;
    bool negative = false;
    if (Serial.read() == '1') negative = true;
    for (int i = 100; i >= 1; i /= 10) {
      correctionFactor += (float)(Serial.read() - '0') * i;
    }
    if (negative) correctionFactor = -correctionFactor;
    rotateStepperBy(correctionFactor);
    positionChange = 0; // reset gyro based corrections
  }

  // Update orientation data with measurements from gyro
