 
 // Arduino setup() and loop()
 void setup() {
+  isVictorious = false;
+  isHot = false;
+  isBad = false;
+  isEmpty = false;
+  badAttempts = 0;
+  
   if (USE_SERIAL) {
     Serial.begin(9600);
   }
-  // pinMode(LED_BUILTIN, OUTPUT);
-
+  pinMode(LED_BUILTIN, OUTPUT);
+
+  pinMode(22, INPUT);
   // Initial switch pins as INPUTs.
-  for (int switch_index = 0; switch_index < GRIDSIZE * GRIDSIZE; switch_index++) {
-    int pin = getSwitchPin(getRow(switch_index), getCol(switch_index));
-    if (pin != NO) {
-      pinMode(pin, INPUT);      
-    }
-  }
+//  for (int switch_index = 0; switch_index < GRIDSIZE * GRIDSIZE; switch_index++) {
+//    int pin = getSwitchPin(getRow(switch_index), getCol(switch_index));
+//    if (pin != NO) {
+//      pinMode(pin, INPUT);      
+//    }
+//  }
   
   // PololuLedStripBase::interruptFriendly = true;
 

//  delay(10);
//}

void loop() {
  bool victory = update();
  leds.write(colors, STRIP_LENGTH);
  delay(50);
  if (victory) {
    delay(500);
    setAllBlue();
  }
}

  bool anyInvalid = false;
  bool anyEmpty = false;
  bool anyWallConstrainsViolated = false;
  int switchesOn = 0;
  for (int index = 0; index < GRIDSIZE * GRIDSIZE; index++) {
    int row = getRow(index);
    int col = getCol(index);
    if (isWall(row, col)) {
      continue;
    } else if (isSwitchOn(row, col)) {
      switchesOn++;
      if (illuminationCount(row, col) > 1) {
        anyInvalid = true;
        setColor(row, col, RED);  // Conflicting lights.
