 }
 
 void WaterOn(){
-  if (!WATERON){
+  if (digitalRead(PUMP_PIN)){
     lcd.setCursor(0, 1);
-    digitalWrite(PUMP_PIN, HIGH);
+    digitalWrite(PUMP_PIN, LOW);
     last_fill_start = millis();
     Alarm.timerOnce(0, FILLTIME_HALF_MINUTES, 0, WaterOff);
     WATERON = true;

unsigned long last_fill_start;

int OVERFLOW_PIN = 2;
bool shitscreek = false;

void setup()
{
  pinMode(PUMP_PIN, OUTPUT);
  pinMode(OVERFLOW_PIN, INPUT);
  
  // LCD Setup

}

void WaterOff(){
  Serial.println("Water OFF");
  digitalWrite(PUMP_PIN, HIGH);
  WATERON = false;
}

void CheckWaterOn(){
  unsigned long diff = millis() - last_fill_start;
  lcd.setCursor(0, 1);
  bool pumping = !digitalRead(PUMP_PIN);
  bool overflowing = !digitalRead(OVERFLOW_PIN);
  
  if (overflowing) {
    lcd.print("WATER OVERFLOW!!");
    digitalWrite(PUMP_PIN, HIGH);
  }
  else if (pumping && diff > FILLTIME_MILLIS){
    lcd.print("Water too long  ");
    Serial.print("Water on passed fill time ");
    Serial.println(diff);
    Serial.println(FILLTIME_MILLIS);
    WaterOff();
  }
  else if (pumping && diff < FILLTIME_MILLIS) {
    lcd.print("Within fill, OK ");
    Serial.println("Within fill cycle, all OK");
  }
  else if (!pumping && WATERON && diff < FILLTIME_MILLIS) {
    lcd.print("Resume fill, OK ");
    Serial.println("Within fill cycle, resume OK");
    digitalWrite(PUMP_PIN, LOW);
  }
  else {
    WaterOff();
    lcd.print("Water off, OK   ");
    Serial.println("Water off, all OK");
  }
}

