   // Initiate LSM303
   compass.init();
 
-  // Enables Accelerometer and Magnetometer
+  // Enables accelerometer and magnetometer
   compass.enableDefault();
 
   compass.setMagGain(compass.magGain_25);                  // +/- 2.5 gauss sensitivity to hopefully avoid overflow problems
   compass.writeMagReg(LSM303_CRA_REG_M, CRA_REG_M_220HZ);  // 220 Hz compass update rate
 
-  float min_x_avg[CALIB_SAMPLES];
-  float min_y_avg[CALIB_SAMPLES];
-  float max_x_avg[CALIB_SAMPLES];
-  float max_y_avg[CALIB_SAMPLES];
+  float min_x_avg[CALIBRATION_SAMPLES];
+  float min_y_avg[CALIBRATION_SAMPLES];
+  float max_x_avg[CALIBRATION_SAMPLES];
+  float max_y_avg[CALIBRATION_SAMPLES];
 
   button.waitForButton();
 
   Serial.println("starting calibration");
 
-  // To calibrate the magnetometer we must spin the Zumo to find the Max/Min
-  // magnetic vectors. This information is used to find North and East.
+  // To calibrate the magnetometer, the Zumo spins to find the max/min
+  // magnetic vectors. This information is used to correct for offsets
+  // in the magnetometer data.
   motors.setLeftSpeed(SPEED);
   motors.setRightSpeed(-SPEED);
 
-  for(index = 0; index < CALIB_SAMPLES; index ++)
-  {
-    // Read in magnetic vector m
+  for(index = 0; index < CALIBRATION_SAMPLES; index ++)
+  {
+    // Take a reading of the magnetic vector and store it in compass.m
     compass.read();
 
     running_min.x = min(running_min.x, compass.m.x);

  motors.setLeftSpeed(-SPEED*adjust - 100);
}

// Converts x and y components of a vector to a heading in degrees
int heading(LSM303::vector v)
{
  float xScaled =  2.0*(float)(v.x - compass.m_min.x) / ( compass.m_max.x - compass.m_min.x) - 1.0;
  float yScaled =  2.0*(float)(v.y -  compass.m_min.y) / (compass.m_max.y - compass.m_min.y) - 1.0;

  int angle = round(atan2(yScaled, xScaled)*180 / M_PI);
  if (angle < 0)
    angle += 360;
  return angle;
}

// Yields the angle difference in degrees between two headings
int relativeHeading(int headingFrom, int headingTo)
{
  if(headingFrom < headingTo)
  {
    return headingTo - headingFrom;
  }
  else
  {
    return headingTo + (360 - headingFrom);
  }
}

// We average 10 vectors to get a better measurement. The motors cause too much (magnetic) noise.
int averageHeading()
{
  LSM303::vector avg = {0, 0, 0};

 *
 *   https://github.com/pololu/LSM303
 *
 * This program first calibrates the compass to account for offsets in
 *  its output. Calibration is accomplished in setup().
 *
 * In loop(), The driving angle then changes its offset by 90 degrees
 * from the heading every second. Essentially, this navigates the
