   BLECentral central = blePeripheral.central();
   // if a central is connected to peripheral:
   if (central) {
-    if (debug) {
-      Serial.print("Connected to central: ");
-    }
+    printIfDebug("Connected to central: ");
     // print the central's MAC address:
-    printIfDebug(central.address());
+    printlnIfDebug(central.address());
     // turn on the LED to indicate the connection:
     digitalWrite(13, HIGH);
     // as long as the central is still connected:

  blePeripheral.addAttribute(turnstyleBleService);
  blePeripheral.addAttribute(turnstyleBleIntCharacteristic);
  blePeripheral.begin();
  printIfDebug("Bluetooth device active, waiting for connections...");

  // configure LCD
  lcd.begin(16, 2);

    if (!isMagSwitchOpen || doorAngle < OPEN_ANGLE) { // Door is closed
      closeDoor();
    } else if ((microsNow - microsLastRead < microsBetweenReads)) { // Door is open, a movement was recently detected, and we are waiting between movements; do not double count or re-record the last passing time because the person may still be passing through.
      printlnIfDebug("Movement Detected");
    } else { // Door is open, but a complete movement has not been discovered recently.
      openDoor();
      ping_1 = closeSonar.ping_cm();
      ping_2 = farSonar.ping_cm();

      // This block and the next have similar logic.  When we detect a ping, we adjust population and reset the latest detection times if the other sensor's last detection time is recent.  Otherwise, we update the current sensor's last detection.
      if (detect(ping_2)) {
