           beepCurrentlyOn = true;
       }
     }
-    
-  }
-  
+  }
   
 }
 
 
 void temperatureWarningCheck(float temperature){
-  if(temperature > TEMP_WARNING){
+
+  if(temperature >= TEMP_MAX){
+    nextState = STATE_TEMP_MAX;
+  
+  } else if(temperature >= TEMP_WARNING){
     static unsigned long lastTempAlert = 0;
 
     unsigned long currentTime = millis();

    return STATE_WINDOW_EXITED;
  } 

}

void changeMCBRelayState(bool state){

  if(currentState != STATE_WINDOW_EXITED){
    currentState = STATE_WINDOW_EXITED;
    changeDisplayBacklight(true);
    shortBeepXTimesNoDelay(1);
    Serial.println("Exited window, bypass resistor");
  }

  passFullCurrentThrough(true);
