 void lockedRotorCheck(){
     if (rpm <= LOCKEDDISCRPM){
         digitalWrite(STARTRELAYPIN, LOW); // immediately shut down if RPM lowByte
-        }                            
-        client.publish(TOPIC_T, "CritErr: Disc rotation is locked, attempting restart");              
+        client.publish(TOPIC_T, "CritErr: Disc rotation is locked, attempting restart"); 
+		Serial.println("Disc motion has been stopped. Attempting Restart");
+		delay(10000);
+		motionControlStart();
+		}                            
+		
 }
 
 void allStop(){
     digitalWrite(STARTRELAYPIN, LOW);
     Serial.println("System in All-Stop");
-    delay(5000);
     client.publish(TOPIC_T, "CritErr: System halted. All stop active. Restart Required");
     allStopVar = 1;
-    loop();
+    delay(10000);
     }    
 void exhibitStatusMsg(){
     char gs_msg [50];

/**************************************/
void sensorPulseCount(){
pulseCount++;
Serial.println(pulseCount);
// expected two pulse counts per rotation, two sensors 
}

void calculateRPM(){
if (millis() - prevMillis == 1000){
    detachInterrupt(HALLSENSORPIN);              //disable interrupts while running calculate
    rpm = pulseCount * 60;          //converting frequency to RPM
    pulseCount = 0;                 //reset pulse counter
    prevMillis = millis();          //update prevMillis
    Serial.print("RPM: ");
    Serial.println(rpm);
    attachInterrupt(digitalPinToInterrupt(HALLSENSORPIN), sensorPulseCount, RISING);
		}
  }

void motionControlStart(){
    Serial.println("Motor Control Start");
    if (restartCount < NUMBEROFRESTARTS){
        digitalWrite(STARTRELAYPIN, HIGH); // enable start relay if not above fail counter
        delay(5000); // wait for 2 second for a rotation 
        if (pulseCount == 0){               // if no rotation detected in interrupt
            digitalWrite(STARTRELAYPIN, LOW); // turn off motor becuase of no rotation
            restartCount++;
            delay (3000); // delay 3 seconds before attempting restart
            pulseCount = 0; // reset pulse count 
            motionControlStart();
            }
        if (pulseCount > 1){
        Serial.println("motion started, system running");
		pulseCount = 0;
        restartCount = 0; // set restart counter to 0, since we're started
        allStopVar = 0; // Set allstop condition to off 
		Serial.print("AllStopVar ");

}    

void discSlipCheck(){
    if (rpm < (DESIREDRPM_TABLE - ROTATIONVARIANCE && allStopVar == 0)){
        discSlipPrecond++;
		Serial.println("Disc is slipping from nominal RPM");
		Serial.println(discSlipPrecond);
        }
    else
        if (rpm >= (DESIREDRPM_TABLE - ROTATIONVARIANCE && allStopVar == 0)){
        discSlipPrecond--;
        }
    if (discSlipPrecond > DISCSLIPCOUNT){
