   // Basic RGB color differentiation can be accomplished by comparing the values and the largest reading will be
   // the prominent color
 
-  if ((red_color > blue_color) && (red_color > green_color))
-    Serial.println("detecting red");
-  else if ((green_color > blue_color) && (green_color > red_color))
-    Serial.println("detecting green");
-  else if ((blue_color > red_color) && (blue_color > green_color))
-    Serial.println("detecting blue");
-  else
-    Serial.println("color not detectable");
-    
+
   const int sizeRow = 9; // RGB
   const int sizeCol = 3; // nine colors
-  int constanterror = 3500;
+  int constanterror = 5000;
   bool redMatch = false;
   bool greenMatch = false;
   bool blueMatch = false;
   long int ary[sizeRow][sizeCol] =
-  { {19000, 12200, 5500}, // red
-    {12000, 6800, 3750}, // orange
-    {35000, 38700, 15150}, // yellow
-    {6700, 15700, 7800}, // green
-    {6050, 1000, 10200}, // blue
-    {11000, 12500, 10900}, // indigo
-    {5200, 4900, 5100}, // violet
-    {200, 120, 55}, // black
-    {44000, 53100, 34200} // white
+  { 
+    {
+      19000, 12200, 5500            }
+    , // red
+    {
+      12000, 6800, 3750            }
+    , // orange
+    {
+      35000, 38700, 15150            }
+    , // yellow
+    {
+      6700, 15700, 7800            }
+    , // green
+    {
+      6050, 1000, 10200            }
+    , // blue
+    {
+      11000, 12500, 10900            }
+    , // indigo
+    {
+      5200, 4900, 5100            }
+    , // violet
+    {
+      200, 120, 55            }
+    , // black
+    {
+      44000, 53100, 34200            } // white
   }; 
-  String colorary [9] = {"red", "orange", "yellow", "green", "blue", "indigo", "violet", "black", "white"};
-  int switchnum;
+  String colorary [9] = {
+    "red", "orange", "yellow", "green", "blue", "indigo", "violet", "black", "white"      };
   for (int y = 0; y < 9; y++)
   {
     if ((red_color < (ary[0][y] + constanterror)) && (red_color > (ary[0][y] - constanterror)))


/*
  Reads the register values for clear, red, green, and blue.
*/
void get_Colors(void)
{
  unsigned int clear_color = 0;

  }
  else if (state == '1') {
    digitalWrite(ledPin, HIGH);
    Serial.println("LED: ON");
    ;
    state = 0;
  } 
  if (Serial.available() > 0) { // Checks whether data is comming from the serial port
    state = Serial.read(); // Reads the data from the serial port
  }
  if (state == '0') {
