 const unsigned long signalVerify = 0xAF0;
 const unsigned long signalConfirm = 0xA70;
 
+
 void setup()  
 {
   // Open serial communications and wait for port to open:
   Serial.begin(9600);
-  pinMode(ledPin, OUTPUT);   
+  pinMode(ledStatusPin, OUTPUT);
+  pinMode(ledSignalPin, OUTPUT); 
   Serial.println("system begins!");
   // set the data rate for the SoftwareSerial port
   XBee.begin(9600);
   irrecv.enableIRIn(); // Start the receiver
 
   randomSeed(analogRead(5));
+
+  readXBeeDeviceId();
+  
+  toggle_time = millis();
+  signal_time = millis();
+
 }
 
 void loop()
 {
+  if(XBee.available()) {
+    digitalWrite(ledSignalPin, HIGH);
+    signal_time = millis();
+  } else if(millis() - signal_time > 500) {
+    digitalWrite(ledSignalPin, LOW);
+  }
+
   switch(state) {
   case IDLE:
     // purely listening and then react by response
     // for now test use random
     // if(irrecv.decode(&results)) {
+
+    digitalWrite(ledStatusPin, LOW);
     
     if(XBee.available()) {
+
       delay(5);
       char packet[50];
       int len = readXBeeString(packet);

      	Serial.println("[CONNECTED] entering state");

      	// turn on the ligth to indicate
      	digitalWrite(ledPin, HIGH);

      	state = CONNECTED;
      }

  case CONNECTED:

    // temporarily for debugging 
    digitalWrite(ledStatusPin, HIGH);
    delay(10000);
    state = IDLE;
    break;
