 boolean stringComplete = false;  // Whether the string is complete
 int outputValue = 0;
 float receivedValue = 0.0;
+int sensorMax = 1024;
 
-boolean levelWasDown = true;
-boolean levelIsDown = true;
+boolean waterLevelWasUp = true;
+boolean waterLevelIsUp = true;
 boolean freeze = false;
 
 void setup() {
   // initialize serial communications at 9600 bps:
   Serial.begin(9600);
     pinMode(pumpPin, OUTPUT); 
-    pinMode(analogOutPin, OUTPUT); 
+    pinMode(valvePin, OUTPUT); 
 }
 
 void serialEvent() {


// These constants won't change.  They're used to give names
// to the pins used:
const int analogOutPin = 3; // Analog output pin that the LED is attached to
const int analogInPin = A0;
const int pumpPin = 4;
const int ledPin = 13;

       Serial.print("Delay: ");
       Serial.println(delayValue);
       digitalWrite(ledPin, LOW);    // turn the LED off by making the voltage LOW
       digitalWrite(valvePin, LOW);    // turn the valve off by making the voltage LOW
       delay(delayValue);         // wait for a second
       digitalWrite(ledPin, HIGH);   // turn the LED on (HIGH is the voltage level)
       if (!freeze) //only if no problem
       {
         digitalWrite(valvePin, HIGH);   // turn the flow on (HIGH is the voltage level)
         dropCounter++;
       }
       delay(1100);               // wait for a second
       
       digitalWrite(ledPin, LOW);
       digitalWrite(valvePin, LOW); 
       
   }
}
