 
 const unsigned int SERVER_PORT = 51420;
 
-//constants for commands
+//constants for command numbers which are sent as the first byte
 const byte CMD_ECHO = 0;
+const byte CMD_SET_LED = 1;
+const byte CMD_READ_TEMP = 2;
+const byte CMD_SET_COLOR_LED = 3;
+
+//constants for the number of data bytes that follow the initial command byte
 const byte CMD_ECHO_DATA_BYTE_COUNT = 2;
-const byte CMD_SET_LED = 1;
 const byte CMD_SET_LED_DATA_BYTE_COUNT = 2;
-const byte CMD_READ_TEMP = 2;
 const byte CMD_READ_TEMP_DATA_BYTE_COUNT = 0;
-const byte CMD_SET_COLOR_LED = 3;
 const byte CMD_SET_COLOR_LED_DATA_BYTE_COUNT = 3;
+
+//convenience array mapping the command numbers to their respective data byte counts
+const byte COMMAND_TO_DATA_BYTE_COUNT_MAP[4] = {CMD_ECHO_DATA_BYTE_COUNT, CMD_SET_LED_DATA_BYTE_COUNT, CMD_READ_TEMP_DATA_BYTE_COUNT, CMD_SET_COLOR_LED_DATA_BYTE_COUNT};
 
 //indicies of data bytes for the SET_LED command
 const byte LED_NUMBER_INDEX = 0;
 const byte LED_ONOFF_INDEX = 1;
 const byte LED_SET_OFF = 0;
 
-//array mapping led numbers to the pin they are on
+//array mapping led numbers to the I/O pin they are on
 const byte LED_PINS[4] = {6, 7, 8, 9};
 
 //analog pin to which the temperature sensor is connected
 const byte TEMP_INPUT_PIN = 0;
 const float ANALOG_STEP = 0.0049;
 
-//pin mappings for the multi-color LED
+//pin mappings for the PWM output pins that drive the multi-color LED
 const byte RED_PIN = 2;
 const byte GREEN_PIN = 3;
 const byte BLUE_PIN = 4;

  EthernetClient client = server.available();
  byte commandByte;
  byte* dataBytes;
  
  if(client){
    Serial.println("\nclient connected");

const byte GREEN_COLOR_INDEX = 1;
const byte BLUE_COLOR_INDEX = 2;

//number of miiliseconds to wait for the client to start sending bytes before timing out
unsigned long CLIENT_TIMEOUT = 10000;

//setup of the ethernet shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 7};
byte gateway[] = { 192, 168, 1, 1 };
