 #include <SoftwareSerial.h>
 #include <IRremote.h>
 #include <string.h>
+#include "utils.h"
 
 // #define DEBUG
-#include "utils.h"
 
-// Trying to elucidate the way communication works first
-// current design enforces a simplest design on the receiver side
-// no scheduling, purely acknowledge everything it has received with a random delay
-#define IDLE 0
-#define PENDING 1
-#define CONNECTED 2
-#define DELAY_IN_WAIT 1000000
+// In this simplified design, there is no need to save states on client for feedback
+// so I have deleted all state variables like IDLE, PENDING, CONNECTED, etc.
 
 SoftwareSerial XBee(2, 3); // RX, TX
 int ledStatePin = 13;

  // 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();

int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;

char deviceId[3] = "??";
char XBeeInString[50];

unsigned int ledStateInterval = 500;
unsigned long randomDelay = 0;
unsigned long start_time;
