   
   //-------------------------------------------------------------
   else if (strcmp(data , "lightReference") == 0) {      //indicate that Rpi wants to set light reference to a new value
-    if(serial_state){
-      Serial.println("entering light ref");               //for debugging
+    if(serial_state){                                   //check to see if serial bus is connected
+      Serial.println("entering light ref");             //for debugging
       Serial.println("---------------------------------------");
     }
     //send_light_data:                                  //used in previous version of this communication protocol

int lightState;                     //to stores whether the light is turned on or off
int fanState;                       //to stores whether the fan is turned on or off
int heaterState;                    //to stores whether the heater is turned on or off
//bool fireAlarm;
//bool gasAlarm;
//bool PIRAlarm;

bool enable = true;                 //enable or disable automatic light control
float onReference  = 3.0;           //referenc voltage to turn light off if below it

//----------------------------------------------------**********************************************************
  else {                                                        //if the incoming message is non of what we and Rpi team agreed upon then some error happened during transmission, send unknown command back
    radio.stopListening();                                      //stop listening because we're about to send UC
    if(serial_state){                                           //check to see if serial bus is connected
      Serial.println("---------------------------------------");
      Serial.println("unknown command!");
      Serial.print("command is: "); Serial.print(data); Serial.print(", or: "); Serial.println((atof(data)));
