       if (!receiverControl) {
         calibrationMode = (boolean) root["calibrationMode"];
         sendJsonBoolean("calibrationMode", calibrationMode);
-        if (calibrationMode) {
-          resetCalibration();
-        } else {
+        if (!calibrationMode) {
           if (calibrationComplete()){
-            isCalibrated = true;
             sendCalibrationJsonData();
           } else {
             sendJsonString("error", "Calibration not complete");
           }
         }
+        //Reset the calibration values (they will later be sent back from the attached USB device)
+        resetCalibration();
       } else {
         sendJsonString("error", "Disable receiver control to change calibration mode");
       }


//Determines whether a given value is valid receiver input
boolean isValidReceiverInput(uint16_t receiverInput) {
  if (receiverInput < RECEIVER_INPUT_MAX && receiverInput > RECEIVER_INPUT_MIN) return true;
  return false;
}

//Processes receiver input for a given servo and writes the converted output to the servo

    if (root.containsKey("throttle")) {
      processServoJson(root["throttle"], throttle, "throttle", listenForThrottle, "Unassigned throttle pin");
    }
    if (root.containsKey("cutover")) {
      //Cutover is input only, so output-only function parameters can be null
      processServoJson(root["cutover"], cutover, "", listenForCutover, "");
    }

    //If the receiver inputs are not yet calibrated, but calibration values were just received, set isCalibrated to true
    if (!isCalibrated && calibrationComplete()) isCalibrated = true;

    //Reset newData to false so we can read new serial input
    newData = false;
  }
}

