     // iterate over the tokens of the message - assumed flat.
     char *p = buf;
     char *str;
+    
+    int red = 0;
+    int green = 0;
+    int blue = 0;
+    int pos = -1;
+    bool colour_change = false;
+    
     while ((str = strtok_r(p, ",", &p)) != NULL) { 
       #ifdef DEBUG
       Serial.println(str);

  #ifdef DEBUG
    Serial.println("Starting Up");
    freeMem("At Start: ");
  #endif
  
  Ethernet.begin(mac);

    Serial.println("Sending data");
    #endif
    client.setDataArrivedDelegate(dataArrived);
    
    // set the connected light to be on.
    digitalWrite(13, HIGH);
  } else {
    #ifdef DEBUG
    Serial.println("Not Connected - check connection and start again");
    #endif
    while (1) {
      //TODO Drop some debug code in here
    }
  }
}

void loop() {
  client.monitor();
  
  // decay the values on the light strip.
  for (int i=0; i < STRIP_LENGTH; i++) {
    if (--modules[i].r < 0) modules[i].r = 0;
    if (--modules[i].g < 0) modules[i].g = 0;
    if (--modules[i].b < 0) modules[i].b = 0;
    
    if (modules[i].r == 0 && modules[i].b == 0 && modules[i].b == 0) {
        ind_colours[i] = 0;
    } else {
        ind_colours[i] = get_colour(modules[i].r, modules[i].g, modules[i].b);
    }
  }
  
