         max += 8;
     }
     int pin = 0;
-    for (int i = 0; i < random(5, max); i++) {
-        if (i % random(1, max / 3) == 0) {
-            if (flickerLetters == 1 && flickerBackground == 1) {
-                pin = random(0, 2) == 0 ? letters[random(0, sizeof(letters))] : background[random(0, sizeof(background))];
-            } else if (flickerBackground == 1) {
-                pin = background[random(0, sizeof(background))];
-            } else {
-                pin = letters[random(0, sizeof(letters))];
-            }
+
+    if (i % random(1, max / 3) == 0) {
+        if (flickerLetters == 1 && flickerBackground == 1) {
+            pin = random(0, 2) == 0 ? letters[random(0, sizeof(letters))] : background[random(0, sizeof(background))];
+        } else if (flickerBackground == 1) {
+            pin = background[random(0, sizeof(background))];
+        } else {
+            pin = letters[random(0, sizeof(letters))];
         }
-
-        digitalWrite(pin, PATTERN_OFF);
-        delay(random(minimal / 2, minimal));
-        digitalWrite(pin, PATTERN_ON);
-        delay(ish);
+    }
+
+    digitalWrite(pin, PATTERN_OFF);
+    delay(random(minimal / 2, minimal));
+    digitalWrite(pin, PATTERN_ON);
+    delay(ish);
+
+    if (repeatCount > 0) {
+        _flickerPattern(flickerLetters, flickerBackground, repeatCount - 1);
     }
 }
 

void setup() {
    randomSeed(analogRead(0));

    for (int i = 0; i < sizeof(Lights); i++) {
        pinMode(Lights[i], PATTERN_INITIALIZE);
    }
}

// code above the man is ignored by the emulator

    int possibility = random(0, 100);

    if (possibility > 95) { // rare things, only happen 5% of the time
        // switch (random(0, 2)) {
        // case 0:
            flickerPattern(random(0, 2), random(0, 2));
            blinkMin = 0;
            // break;
        // case 1:
            // blinkAllOnRandom();
            // blinkMax = 3;
            // break;
        // }
    } else if (possibility > 70) { // less rare things, happen 25% of the time
        if (random(0, 200) == 0) {
            runBackgroundPattern();
