 #define MATRIX_DATA_PIN 6       // The Pin where the matrix is connected to.
 #define MATRIX_SNAKE_PATTERN 1  // Set 1 if the Matrix has a snake-pattern.
 #define MAX_BRIGHTNESS 50       // The maximum brightness the firmware allow.
-
-
-
+#define BAUDRATE 250000         // Set the Baudrate (higher is better)
+
+
+/*
+* Include all headerfiles.
+*/
 #include <stdint.h>
 #include <string.h>
 #include <Adafruit_NeoPixel.h>
+
+
+/*
+* Define the LED Matrix.
+*/
 Adafruit_NeoPixel strip = Adafruit_NeoPixel(256, MATRIX_DATA_PIN, NEO_GRB + NEO_KHZ800);
 
 
+/*
+* Setup the Matrix and the serial communication.
+*/
 void setup()
 {
   strip.begin();
-  strip.show(); // Initialize all pixels to 'off'
-  Serial.begin(250000);
   strip.setBrightness(MAX_BRIGHTNESS);
   strip.show();
-}
-
-
-#define cmdBrightness '0'
-#define cmdFrame '1'
-#define cmdRow '2'
-#define cmdColum '3'
-#define cmdPixel '4'
-#define cmdSave '5'
+  Serial.begin(BAUDRATE);
+}
+
+
+/*
+* Some constants wich defines the communication.
+*/
+#define cmdBrightness '1'
+#define cmdPixel '2'
+#define cmdFrame '3'
+#define cmdSave '4'
 #define cmdBrightnessLength 4
 #define cmdFrameLength 1537
-#define cmdRowLength
-#define cmdColumLength
 #define cmdPixelLength 9
-#define cmdSaveLength
-
-
-char buffer[2000] = "";
+#define cmdSaveLength // not implemented yet
+
+
+/*
+* All variables needed to work with the buffer.
+*/
+#define BUFFER_SIZE 1600
+char buffer[BUFFER_SIZE] = "";
 uint16_t bufferLength = 0;
 
+
+/*
+* This function sets the brightness of the whole Matrix.
+*/
 void setBrightness()
 {
   // Checking if the command has the right length
   if (bufferLength != cmdBrightnessLength)
   {
     // The command was too long or too short
-    Serial.println("ERROR: updateBrightness wrong length.");
-    return;
-  }
-
+    Serial.println("ERROR: Command \"setBrightness\" had the wrong length!");
+    return;
+  }
+
+  // convert the buffer to an int.
   uint16_t brightness = (buffer[1] - '0') * 100;
   brightness += (buffer[2] - '0') * 10;
   brightness += buffer[3] - '0';

  strBlue[0] = buffer[7];
  strBlue[1] = buffer[8];

  red = (uint8_t)strtol(strRed, NULL, 16);
  green = (uint8_t)strtol(strGreen, NULL, 16);
  blue = (uint8_t)strtol(strBlue, NULL, 16);

  strip.setPixelColor(stripPixel, red, green, blue);
  strip.show();
}


  char strRow[2] = "";
  char strColum[2] = "";

  // Create the strings for the row & colum
  strRow[0] =  buffer[1];
  strColum[0] =  buffer[2];

  // Convert the strings to ints
  row = (uint8_t)strtol(strRow, NULL, 16);
  colum = (uint8_t)strtol(strColum, NULL, 16);

  // Fix the snake pattern of the leds on the matrix if needed
  #if MATRIX_SNAKE_PATTERN == 1
  if (row % 2 == 1)
  {
    colum = 15 - colum;
  }
  #endif

  // Calculate the current pixel
  stripPixel = (row << 4) + colum;  // shift by 4 is like multiply by 16 but faster

  // Create the strings for the color
  strRed[0] = buffer[3];
  strRed[1] = buffer[4];
  strGreen[0] = buffer[5];
