     average += rps[idx];
 
   // calculate RPM from the RPS moving average
+  average /= RPM_AVG;
   average *= 60;
-  average /= RPM_AVG;
   average /= MAGS;
 
   // reset mag_count for the next pass


  // pull up to start
  pinMode(HALL, INPUT_PULLUP);
  pinMode(QUESTION, OUTPUT);
  digitalWrite(QUESTION, HIGH);

  // initialize variables
  switched = 0;

#define MAGS 4
#define RPM_AVG 5
#define HALL P1_5

#define SHIFT_OFFSET 10

