         case '?' : { // display contents of *rgb: three colors and a null pointer
           Serial.println("Current color values:");
           for (int i=0; i<3; i++) {
-            Serial.print(*rgb[i]); Serial.print(',');
+            Serial.print(*rgb[i]);
+            Serial.print(',');
           }
           Serial.println(*rgb[3]);
-        } 
+        }
       }
-    }
-  }
-}
-
-void toggleDebug() {
-  debugMode=!debugMode;
-  Serial.print("Debug mode ");
-  if(debugMode) {
-    Serial.println( "ON");  }
-  else {
-    Serial.println("OFF");  }
-}
-
-void processColor(char input[]) {
-  char colorInput[] = {input[1],input[2],input[3],input[4],input[5],input[6],input[7],'\0'}; // who needs loops
+}
+
+void processColor() {
+  gradientThread.disable(); // cut off anything else
+  gradientLoop = false;  
+  char colorInput[] = {inputBuffer[1], //premature
+                       inputBuffer[2], //optimization
+                       inputBuffer[3], //but also
+                       inputBuffer[4], //laziness
+                       inputBuffer[5],
+                       inputBuffer[6],
+                       inputBuffer[7],'\0'};
   if (debugMode) {
     Serial.print("Serial input:"); 
     Serial.println(colorInput);  }

void processSerial() {
  Serial.readBytesUntil('\n',inputBuffer,SERIAL_BUFFER_LENGTH);
  if (inputBuffer!="") { // if connected
    recentActivity = true;   
    switch (inputBuffer[0]) {
      case 'd': {
        toggleDebug();
        break;
      }
      case 'V': { // set value specified in V#FFFFFF input
        processColor(inputBuffer);
        break;
      }
      
      case 'G' : {
        processGradient(inputBuffer);
        break;
      }
  
      case 'L' : {
        gradientLoop = true;
        processGradient(inputBuffer);
        break;
      }
    }
    if (debugMode) {
      switch(inputBuffer[0]) {
        case '0' : {
          setValue(0,0,0);

  Serial.println(blue, HEX);
}


//void arrayCopy( int *recipient, const int *donor, int len ) { // make this more generic - should work on ints and chars
//  //be very careful with len
//  for (int x = 0; x<len; x++) {
//    recipient[x] = donor[x];
//  }
//}

void quickCycle(int baseTime) {
  setValue(255,0,0);
