 const int ledPins[LED_PIN_COUNT] = {8, 9, 10, 13};
 #endif
 
+// Lists are 2 + (9 * dimension) bytes,
+// so incidentally a 255-byte max data length
+// limits this demo's lists to 28 elements.
 #define MAXDATALEN 255
+
 uint8_t header[16];
 uint8_t data[MAXDATALEN];
 
+// Run once when the Arduino resets. This first sets
+// the LED pins to OUTPUT, then initializes a new CBL2
+// instance. This is responsible for dealing with the
+// actual calculator<->Arduino message exchange.
 void setup() {
   for(int i = 0; i < LED_PIN_COUNT; i++) {
     pinMode(ledPins[i], OUTPUT);
 	digitalWrite(ledPins[i], LOW);
   }
 
-  Serial.begin(9600);
+  Serial.begin(9600);                           // Used for debugging
   cbl = new CBL2(lineRed, lineWhite);
   cbl->resetLines();
-  // cbl->setVerbosity(true, &Serial);			// Comment this in for mesage information
+  // cbl->setVerbosity(true, &Serial);			// Comment this in for verbose message information
+  
+  // The following registers buffers for exchanging data, the maximum
+  // allowed data length, and functions to call on Get() and Send().
   cbl->setupCallbacks(header, data, MAXDATALEN,
                       onGetAsCBL2, onSendAsCBL2);
 }
 
+// Repeatedly check to see if the calculator has initiated a Get()
+// or a Send() operation yet. If it has, then onGetAsCBL2() or
+// onSendAsCBL2() will be invoked, since they were registered in
+// setup() above.
 void loop() {
   int rval;
   rval = cbl->eventLoopTick();

  return 0;
}

int onSendAsCBL2(uint8_t type, enum Endpoint model, int* headerlen,
                 int* datalen, data_callback* data_callback)
{

  Serial.print(type);
  Serial.print(" from endpoint of type ");
  Serial.println((int)model);
  return -1;		// -1 means we have no data to send.
}