       
       if (atoi(p.id) == atoi(deviceId) && p.type[0] == 'c') {
       	// have been confirmed
-      	DEBUG_PRINTLN("[CONNECTED] entering state");
-      	state = CONNECTED;
+        DEBUG_PRINTLN("[CONNECTED] entering state");
+        state = CONNECTED;
       }
       // verifying this selection
       else if (atoi(p.id) == atoi(deviceId) && p.type[0] == 'v') {
-      	// have been confirmed
-      	DEBUG_PRINTLN("[WAIT] being verified");
-
-      	// may flash the light to indicate this
-      	ledStateInterval = 200;
-      	state = PENDING;
-      }      
+        // have been confirmed
+        DEBUG_PRINTLN("[WAIT] being verified");
+
+        // may flash the light to indicate this
+        ledStateInterval = 100;
+        state = PENDING;
+      }
       // verifying this selection
       else if (atoi(p.id) != atoi(deviceId) && p.type[0] == 'v') {
-      	// have been confirmed
-      	DEBUG_PRINTLN("[WAIT] verifying others");
-	ledStateInterval = 500;
-      	state = PENDING;
-      }      
+        // have been confirmed
+        DEBUG_PRINTLN("[WAIT] verifying others");
+	ledStateInterval = 600;
+        state = PENDING;
+      }
+      // verifying this selection
+      else if (atoi(p.id) != atoi(deviceId) && p.type[0] == 'c') {
+        // have been confirmed
+        DEBUG_PRINTLN("[IDLE] connected with others");
+        state = IDLE;
+      }
       else {
-      	DEBUG_PRINTLN("[IDLE] id not equal");
-      	state = IDLE;
+        DEBUG_PRINTLN("[IDLE] id not equal");
+        state = IDLE;
         irrecv.resume();
       }
     }

      }
      
      if (atoi(p.id) == atoi(deviceId) && p.type[0] == 'i') {
      	// all sorts of instructions
      	DEBUG_PRINTLN("[CONNECTED] command issued");
	if (strcmp(p.data, "0001") == 0) {
	  digitalWrite(controlledPin, HIGH);
	  Serial.print("p");

    }
    
    if(XBee.available()) {
      start_time = millis();
      // delay for the complete of transmission
      delay(10);
      DEBUG_PRINTLN("[WAIT] Reading Packet");
