 
 }
 
-void processArrayOfCommands(ArduinoJson::Parser::JsonObject root) {
-  JsonArray commands = root["lightData"];
-  if (!commands.success())
+void processMultiLightCommand() {
+  long numberOfCommands  = (int)packetBuffer[1] & 0xFF;
+  
+  for (int i = 0; i < numberOfCommands; ++i)
   {
-    error2();
-    resetPacketBuffer();
-    return;
-  }
-  for (int i = 0; i < commands.size(); ++i)
-  {
-    processCommand(commands[i]);
-  }
-}
-
-
+    processSingleLightCommand(i*7);
+  }
+}
+
+void error() {
+  Serial.println(F("Unknown COMMAND failed"));
+  lights = &lights_13;
+  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_WARMWHITE);
+  delay(100);
+  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_RED);
+  delay(100);
+  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_WARMWHITE);
+  delay(100);
+  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_RED);
+  delay(100);
+
+  Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
+  Udp.write(ReplyError);
+  Udp.endPacket();
+}
 
 color_t getColor(long colorSelect, long r, long g, long b) {
   color_t color = COLOR(r, g, b);

  } else if (lightStringIndex == 13) {
    lights = &lights_13;
  }
}

void error() {
  Serial.println(F("JsonParser.parse() failed"));
  lights = &lights_13;
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_WARMWHITE);
  delay(100);
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_RED);
  delay(100);
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_WARMWHITE);
  delay(100);
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_RED);
  delay(100);

  Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
  Udp.write(ReplyError);
  Udp.endPacket();
}

void error2() {
  Serial.println(F("JsonParser2.parse() failed"));
  lights = &lights_13;
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_WARMWHITE);
  delay(100);
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_BLUE);
  delay(100);
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_WARMWHITE);
  delay(100);
  lights->fill_color(0, lights->get_light_count(), G35::MAX_INTENSITY, COLOR_BLUE);
  delay(100);

  Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
  Udp.write(ReplyError);
  Udp.endPacket();
}

void allOffFade(long fadeDelay) {

  int packetSize = Udp.parsePacket();
  if (packetSize)
  {
    Serial.print(F("Received packet of size: "));
    Serial.println(packetSize);

    // read the packet into packetBufffer
    Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
//    Serial.println(F("Data: "));
//    Serial.println((int)packetBuffer[0] & 0xFF);
//    Serial.println((int)packetBuffer[1] & 0xFF);
//    Serial.println((int)packetBuffer[2] & 0xFF);
//    Serial.println((int)packetBuffer[3] & 0xFF);
//    Serial.println((int)packetBuffer[4] & 0xFF);
//    Serial.println((int)packetBuffer[5] & 0xFF);
//    Serial.println((int)packetBuffer[6] & 0xFF);

    int command  = (int)packetBuffer[0] & 0xFF;
    Serial.print(F("Got command: "));
    Serial.println(command);
    if (command==0) {
      processSingleLightCommand(0);
    } else if (command==1) {
      processMultiLightCommand();
    } else if (command==2) {
      allOffFade(packetBuffer[1] & 0xFF);
    } else {
      Serial.print(F("Unknown Command: "));
      Serial.println(command);
