           reconfiguration(); //Start reconfiguration code
         }
         else if (input == '2') { //a heartbeat came in, respond
+          heartbeat(true);
+        }
+
+      }
+      else {
+        //OPMODE BROKE! WARN!
+        blinkRate = 0;
+      }
+    }
+  }
+
+  if (bluetooth.available()) {
+    delay(10); //this is needed
+
+    char cleanout = ' ';
+    char input = ' ';
+    
+    cleanout = bluetooth.read();
+    input = bluetooth.read();
+    
+    //if the beginning of a command is found (takes care of "|\0" and "||" possible cases)
+    if (cleanout == '|' && input != '|') {
+      if (opMode == sensor) {
+        if (input == '2') { //a heartbeat came in, respond
           heartbeat(true);
         }
 


    }
    else if (opMode == sensor) {
      //increment the return value by one, and send back
      bluetooth.print("|" + String(200 + checkReturned + 1) + "|");
      return 2;

    }
  }

  if (Serial.available()) {
    char cleanout = ' ';
    char input = ' ';

