 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) {

    }
    Serial.println("");

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

        phaseAvg[i] = norm_rads(phaseAvg[i]);
        // Serial.print("Phase    : "); Serial.println(phase);
        // Serial.print("Phase: "); Serial.println(_phase_avg);
    }

    winningIndex = maxIndex;
    //if (_phase_avg > 0) {
    //  digitalWrite(LED_PIN, LOW);
    //} else {
    //  digitalWrite(LED_PIN, HIGH);
    //}

    return ret;
}

