         right.write(rightBackwardSpeed + turnBoost);
       }
     }
-    else if (mag2.magnetic.x > (X_calibration - drift_threshold_backup))
+    else if (mag2.magnetic.y > (Y_calibration - drift_threshold_backup))
     {
       #ifdef debug
         Serial.println("Turn left");

  int Z_threshold = 0;
  uint8_t count = 0;
  bool crossing = false;
  int X_calibration = 0;
  uint8_t countdown = 5;
  elapsedMillis mils;
  elapsedMillis speedAdjust;

  }
  gyroCorrect = cur / 10.0;
  
  Y_calibration /= 10;

  timeUp = false;
  timeout.begin(timedOut, 1001000 * spaces);
