   int green      = 0;
   int blue       = 0;
   int brightness = 0;
-}
+};
 
+// Current LED state
 LED *leds;
+
+// Message buffer
+char *msgBuf;
+int bufferPos;
+
+// Last read byte from serial
+char readByte;
 
 void setup() {
   Serial.begin(115200);
+  Serial.println("This is a butts test");
   allocateMemory();  
   updateLeds();
 }
 
 void loop() {
-  while(Serial.available > 0) {
-    string command = Serial.readString();
-    if(processCommand(command)) {
-      updateLeds();
-    }    
+  while(Serial.available() > 0) {
+    readByte = Serial.read();
+    msgBuf[bufferPos] = readByte;
+    bufferPos++;
+    if(bufferPos >= MSG_BUFFER_SIZE) {
+      // Prevent buffer overrun
+      bufferPos = 0;
+    }
+    if(readByte == '\n') {
+      // End of message, process the message
+      if(processCommand(msgBuf, bufferPos)) {
+        updateLeds();
+      }
+      // Reset buffer position
+      bufferPos = 0;
+    }
   }
 }
 
 void allocateMemory() {
   leds = (LED*)calloc(currentLedCount, sizeof(LED));
+  msgBuf = (char*)calloc(MSG_BUFFER_SIZE, sizeof(char));
 }
 
 void freeMemory() {
   free(leds);
+  free(msgBuf);
 }
 
 /**
  * Process a command and update the uController state
  */
-boolean processCommand(string command) {
-  
+boolean processCommand(char command[], int commandLength) {
+  if(command[0] == 'C') {
+    // Configuration update
+    char *seperator = strchr(command, ':');
+    if(seperator != NULL) {
+      seperator++;      
+      int ledCount = atoi(seperator);
+      if(ledCount > 0) {
+        updateConfig(ledCount);
+      }
+    }
+  } else if(command[0] == 'U') {
+    // LED update
+    // TODO: LED update
+    return true;
+  }
+  return false;
 }
 
-void updateLeds(int ledNumber, int red, int green, int blue, int brightness);
+void updateLed(int ledNumber, int red, int green, int blue, int brightness) {
+  // TODO: update LED
+}
 
 void updateConfig(int ledCount) {
-  
+  boolean reallocate = currentLedCount != ledCount;
+  currentLedCount = ledCount;
+  if(reallocate) {
+    freeMemory();
+    allocateMemory();
+  }
 }
 
+void updateLeds() {
+  // TODO: update LED strip
+}
+

// Default # of LEDs this controller is driving
const int DEFAULT_LED_COUNT = 180;

// Current # of LEDs this controller is driving
int currentLedCount = DEFAULT_LED_COUNT;


/**
 * LED Controller:
 *  - Receives configuration updates over serial
