    * Setup function - run once on power-on
    **/
   void setup() {
+
+    // The baud rate is ignored and communication always occurs at full USB speed.
+    // http://www.pjrc.com/teensy/td_serial.html
     Serial.begin(9600);
 
-    // Initialize pushbutton pins as inputs with the internal pullup resistor enabled
+    // Initialize pushbutton pins as inputs with the internal pullup resistor enabled.
+    // http://www.pjrc.com/teensy/tutorial3.html
     for (byte i = 0; i < NUMBER_OF_BUTTONS; i++) {
       pinMode(BUTTON_PINS[i], INPUT_PULLUP);
     }
 
-    // Initialize LED pins
+    // Initialize LED pins as output
     for (byte i = 0; i < NUMBER_OF_LEDS; i++) {
       pinMode(LED_PINS[i], OUTPUT);
       analogWrite(LED_PINS[i], 255);

 * http://www.pjrc.com/teensy/td_libs_Bounce.html - About button bouncing
 * http://www.pjrc.com/teensy/pinout.html - Teensy pinout diagram
 * http://www.pjrc.com/teensy/td_usage.html - Reprogramming
 **/

#include <Bounce.h>

#define DEBOUNCE 10  // Number of ms to debounce
#define NUMBER_OF_BUTTONS 8
#define NUMBER_OF_LEDS 6 // 2 RGB LEDs

// Define digital pins for the buttons
const byte BUTTON_PINS[] = {
  0, 1, 2, 3, 7, 8, 20, 21};

// Define PWM pins for the RGB LED
// LED0-R, LED0-G, LED0-B; LED1-R, LED1-G, LED1-B
const byte LED_PINS[] = {
  9, 5, 10, 14, 12, 15};

// The Piezo buzzer sits in this PWM pin
const byte BUZZER_PIN = 4;

// Initialize button objects
Bounce buttons[NUMBER_OF_BUTTONS] = {
  Bounce( BUTTON_PINS[0], DEBOUNCE),
  Bounce( BUTTON_PINS[1], DEBOUNCE),

{
  char separator = ' ';
  int found = 0;
  int strIndex[] = { 0, -1  };
  int maxIndex = data.length() - 1;

  for(int i = 0; i <= maxIndex && found <= index; i++){
    if(data.charAt(i) == separator || i == maxIndex){
      found++;
      strIndex[0] = strIndex[1]+1;
      strIndex[1] = (i == maxIndex) ? i + 1 : i;
    }
  }

  return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}

/**
