 
 double c2f (double c) {
   return ((9*c)/5 + 32);
+}
+
+const int numReadings = 20;
+double tempReadings[numReadings];  //an array of analog readings
+int smoothingIndex = 0;      //index for readings
+double smoothingTotal = 0;      //the running total
+
+double smoothTemp (double newReading) {
+  smoothingTotal -= tempReadings[smoothingIndex];
+  tempReadings[smoothingIndex] = newReading;
+  smoothingTotal += tempReadings[smoothingIndex];
+  smoothingIndex ++;
+
+  if(smoothingIndex == numReadings)
+    smoothingIndex = 0;
+
+  return (smoothingTotal/numReadings);
 }
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);

  Serial.begin(9600);
}

void loop() {
  //current timer variables to reset at each iteration


byte displayNum[] = {off, off, off, off};  //array for display numbers from msb to lsb

void setup() {
  //setup  pin modes to output
  for (int i=0; i<4; i++)
