 void loop()
 {
   // Main loop
-  // 8 ports, from 0 to 7
+  // LASTPORT+1 ports, from 0 to LASTPORT
   for (int i = 0; i <= LASTPORT; i++) {
+    r0 = bitRead(i,0);    // use this with arduino 0013 (and newer versions)     
+    r1 = bitRead(i,1);    // use this with arduino 0013 (and newer versions)     
+    r2 = bitRead(i,2);    // use this with arduino 0013 (and newer versions) 
+    digitalWrite(2, r0);
+    digitalWrite(3, r1);
+    digitalWrite(4, r2);
     if(digitalRead(BUTTONPORT) == HIGH) {
       // Make sure that this is the first time that the button
       // has been pressed

#define note2 0x3E
#define note1 0x3C

int buttonState = 0;
int currentInstrument = 0;


      // Button is no longer pressed, so reset the button state.
      buttonState = 0;
    }
    if(analogRead(0) > THRESHOLD) {
      /* Apply the AND operator to the lastNote indicator and the
       * corresponding value from the laser array to check if the
       * laser bit has been set or not
