     digitalWrite(air, HIGH);
     delay(30000);
     digitalWrite(air, LOW);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+
+    int timedisplay = round((airduration-(millis()-starttime))/60/1000);
+    measurevol();
+    lcd.setCursor(0,1);
+    lcd.print(tank);lcd.print("gal  ");
+    lcd.print(timedisplay);lcd.print("min  ");
+    //delay(20000);
+    }
+    digitalWrite(air, LOW);
+}
+void halftimeair(float airduration, int lvl){//duration in min check depth and keep air on and pumps off for time period
+  airduration=airduration*60*1000;
+  lcd.clear();
+  lcd.setCursor(0,0);
+  lcd.print("halftimeAir ");
+  lcd.setBacklight(GREEN);
+  measurevol();
+  lcd.setCursor(0,1);
+  lcd.print(tank);
+  float starttime = millis();
+  delay(100);
+  while (((millis()-starttime)<airduration)&&(tank>lvl)){  //2 min
+    digitalWrite(air, HIGH);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    delay(30000);
+    digitalWrite(air, LOW);
+    delay(30000);
+    delay(30000);
     delay(30000);
     delay(30000);
     delay(30000);

      measurevol();
      lcd.setCursor(0,1);
      lcd.print(tank);lcd.print("gal");
      if ((airadd == 1) && (millis()-lastair > 300000)){
       digitalWrite(air,HIGH);
       lastair = millis();



void fill(int lvl, int airadd){//check depth and fill until level is 25gal plus stir
  if (lvl<19){
    digitalWrite(stir, HIGH);
  }
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("FILL ");
