     }
 
     for (int channel = 0; channel < channelCount; channel++) { 
-      channelMean[channel] = (channelMean[channel] + 
-                              smoothedSenseHistory[channel][(smoothedSenseIter + 1 + smoothedSenseSize) % smoothedSenseSize]) / 2;
+      channelMean[channel] = (channelMean[channel] * 3 + 
+                              smoothedSenseHistory[channel][(smoothedSenseIter + 1 + smoothedSenseSize) % smoothedSenseSize]) / 4;
       Serial.print(", ");
       Serial.print(smoothedSenseHistory[channel][smoothedSenseIter] - channelMean[channel]);
       Serial.print(", ");
 
-      if (channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter] > 25) { 
-        chanThreshold[channel] = 3;
-      }
+//      if (channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter] > 25) { 
+//        chanThreshold[channel] = 3;
+//      }
 
       if (switchedCount == 0 && 
           channelMean[channel] - smoothedSenseHistory[channel][smoothedSenseIter] > chanThreshold[channel] && 

int smoothedSampleTemp[smoothedSenseSize - smoothedTouchWindow];

int channelMean[] = {0, 0, 0, 0};
int chanThreshold[] = {1,1,1,1};

void loop() {
    senseResults = senseAll(1500, true);

      switchedCount--;
    }
    
    delay(8);
}
