   lcd.print(tank);
   //write conditions for running sequence here and add functions
   while (x<1){
-    normalsequence();
+   loading();
     x++;}
   }
-void weekend(){
-  aeration(15, 4);
-  rest(45);
-}
-void normalsequence(){
-  DateTime now = rtc.now();
-  starttime = now.unixtime();
-  //fill(10);
-  now = rtc.now();
-  starttime = now.unixtime();
-  //fill(13);
-  now = rtc.now();
-  starttime = now.unixtime();
-  fill(16);
-  now = rtc.now();
-  starttime = now.unixtime();
-  fill(19);
-  now = rtc.now();
-  starttime = now.unixtime();
-  fill(22);
-  now = rtc.now();
-  starttime = now.unixtime();
-  fill(25);
-  now = rtc.now();
-  delay(5000);
-  aeration(240, 24);
-  delay(5000);
-  settle(60, 24);
-  delay(5000);
-  skim(60);
-  delay(5000);
-  settle(120,24);
-  delay(5000);
-  decant(6);
-  delay(5000);
-  //rest(5);
-  delay(5000);
-}
+
 void fill(int lvl){//check depth and fill until level is 25gal plus stir
   digitalWrite(stir, HIGH);
   lcd.clear();

      delay(15000);
    }
    digitalWrite(fillpump, LOW);
    periodicaeration(15,60, now.unixtime());
    delay(15000);
}}

void periodicaeration(float ontime, float onfreq, float tt){//on for 15 min freq is 60 min
  ontime=ontime*60*1000;
  onfreq=onfreq*60*1000;
  if (onfreq-ontime>tt-starttime){
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Periodic Aeration ");
  DateTime now = rtc.now();
  float current = now.unixtime();
  while (current-tt < ontime){
    float timedisplay= (ontime-(current-tt))*1000*60;
    lcd.setCursor(0,1);
  lcd.print(timedisplay);
  delay(1000);
  digitalWrite(air, HIGH);
  DateTime now = rtc.now();
  current = now.unixtime();
  }
digitalWrite(air, LOW);  }
  }
void aeration(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();

int depth = A0;
int x=0;
float starttime;
float begintime;
float tank;
float airtimer;
void setup() {
