 
 void loop() { 
   bool standby = true;
-  unsigned char responseFlag = NULL;
+  bool responseFlag = false;
   unsigned long elapsedTime = 0;
   
   // send command packet to RDM880 to read serial number every second
   MF_GET_SNR(0x00);
   delay(100);
   digitalWrite(ledPin, LOW);
-
+  
+  // get response packet and return a flag if a packet other than idle is detected
   responseFlag = getResponse(responseFlag);
   
   // LED on if an RFID is detected (idle packet only contains 7 bytes)
-  if(responseFlag != NULL) {
+  if(responseFlag == true) {
     digitalWrite(ledPin, HIGH);
     // Machine is ready to fire, get ready to track time
     standby = false;

  }

  if (response[7] != NULL)
    return response[7];
  else
    return NULL;   
}

void MF_GET_SNR(unsigned char DADD) {
  unsigned char CMD[] = { STX, DADD, 0x03, CMD_GET_SNR, 0x26, 0x00, 0x00, ETX};
  RDM880.write(CMD, 8);
}


  }
}

unsigned char getResponse(bool responseFlag) {
  int i = 0;
  unsigned char response[bufferSize];
  response[7] = NULL;
