 float phaseRateAverage[END_INDEX];
 float magAvg[END_INDEX];
 
-bool updatePhase(const float mag[], const float phases[], uint16_t startIndex, uint16_t endIndex) {
+float updatePhase(const float mag[], const float phases[], uint16_t startIndex, uint16_t endIndex) {
     float maxMag = -1000;
     uint16_t maxIndex = startIndex;
-    bool ret = false;
+    bool ret = 0;
     for (int i = startIndex; i < endIndex; i++) {
-        if (i <= 0) {
-          continue;
-        }
         float magnitude = mag[i];
         magAvg[i] = magAvg[i] * 0.99 + magnitude * 0.01;
         if (magAvg[i] > maxMag && i > 0) {

      yield();
      continue;
    }
    for (int i = 0; i < samplesRead; i++) {
      float newVal = tempBuffer[i];
      //acc += newVal * newVal;

    }
    Serial.println("");

    Serial.print("Mag:\t");
    for (int i = 0; i < endIndex; i++) {
      float mag = magAvg[i];
      Serial.print(mag);
