 
       DEBUG_PRINTLN("[PENDING] entering PENDING state");
       state = PENDING;
-      } else if(irrecv.decode(&results)) {
-        delay(5);
-
-
-        DEBUG_PRINT("\nIR received: ");
-        DEBUG_PRINTLN(results.value);
-
-        randomDelay = random(1000);
-        delay(randomDelay);
+    } else if(irrecv.decode(&results)) {
+      delay(5);
+
+
+      DEBUG_PRINT("\nIR received: ");
+      DEBUG_PRINTLN(results.value);
+
+      randomDelay = random(1000);
+      delay(randomDelay);
 
       // send back acknowledge packet
       

    char a[2];
    itoa(id, a, 10);
    deviceId[1] = a[0];
    } else {
      itoa(id, deviceId, 10);  
    }

    Serial.print("my devide ID: ");
    Serial.println(deviceId);  
  }

      }
    }
    break;
  case CONNECTED:
    // temporarily for debugging 
    // turn on the ligth to indicate
    digitalWrite(ledStatePin, HIGH);
