 
 unsigned long startMillis = 0;
 
+float mean     = 0.0;
+float deviance = 0.0;
+int count = 0;
+
 void setup()
 {
   Serial.begin(9600);
   pinMode(speakerPin, OUTPUT);
-  digitalWrite(speakerPin, LOW);
+  for (int i = 0; i < 5; i++)
+  {
+    digitalWrite(speakerPin, HIGH);
+    delay(50);
+    digitalWrite(speakerPin, LOW);
+    delay(50);
+  }
+
 }
 
 void loop()

    {
      unsigned long duration = millis() - startMillis;

      // shutter values are listed in 1/x s
      float shutter = 1000.0 / duration;

      Serial.print("Shutter detected: 1/");
      Serial.print(shutter);
      Serial.print("s (");
      Serial.print(duration);
      Serial.println("ms)");
      light = false;

    }
    digitalWrite(speakerPin, LOW); // stop speaker

    {
      startMillis = millis();
      light = true;
      digitalWrite(speakerPin, HIGH); // start speaker
    }
  }
  else // lightValue < threshold
  {
