       // We use the value at the (i,j) coordinate in the noise
       // array for our brightness, and the flipped value from (j,i)
       // for our pixel's hue.
-      leds[XY(i,j)] = CHSV(noise[j][i],255,noise[i][j]);
+      buffer[kMatrixHeight*j + i] = CRGB(CHSV(noise[j][i],255,noise[i][j]));
 
       // You can also explore other ways to constrain the hue used, like below
-      // leds[XY(i,j)] = CHSV(ihue + (noise[j][i]>>2),255,noise[i][j]);
+      // buffer[kMatrixHeight*j + i] = CRGB(CHSV(ihue + (noise[j][i]>>2),255,noise[i][j]));
     }
   }
   ihue+=1;
 
-  // N.B. this requires SmartMatrix modified w/triple buffering support
-  pSmartMatrix->fillCircle(circlex % 32,circley % 32,6,CRGB(CHSV(ihue+128,255,255)));
+  matrix.fillCircle(circlex % 32,circley % 32,6,CRGB(CHSV(ihue+128,255,255)));
   circlex += random16(2);
   circley += random16(2);
-  LEDS.show();
+  matrix.swapBuffers(false);
   LEDS.countFPS();
   // delay(10);
 }

  // Serial.begin(38400);
  // Serial.println("resetting!");
  delay(3000);
  LEDS.addLeds<SMART_MATRIX>(leds,NUM_LEDS);
  LEDS.setBrightness(96);

  // Initialize our coordinates to some random values
  x = random16();

  static uint8_t circlex = 0;
  static uint8_t circley = 0;


  rgb24 *buffer = matrix.backBuffer();  
  
  static uint8_t ihue=0;
  fillnoise8();
  for(int i = 0; i < kMatrixWidth; i++) {
