   hue = hue + 1;
 }
 
+void beautifulSparkles() {
+  fadeToBlackBy(leds, NUM_LEDS, 200);
+  numberOfSparkles = upAndDownBy(numberOfSparkles, 1);
+  for (int i = 0; i < numberOfSparkles * 4; i++) {
+    int pos = random16(NUM_LEDS);
+    leds[pos] = CHSV(hue + (pos / 10), 240, 255);
+  }
+  hue += 10;
+}
+
 void sparkles() {
   fadeToBlackBy(leds, NUM_LEDS, 200);
   numberOfSparkles = upAndDownBy(numberOfSparkles, 1);
   for (int i = 0; i < numberOfSparkles * 4; i++) {
     int pos = random16(NUM_LEDS);
-    if (patternId == BEAUTIFUL_SPARKLES) {
-      leds[pos] = CHSV(hue + (pos / 10), 240, 255);
-    } else if (patternId == SINGLE_COLOR_SPARKLES) {
-      leds[pos] = CHSV(hue, 240, 255);
-    }
-  }
-
-  if (patternId == BEAUTIFUL_SPARKLES) {
-    hue += 10;
-  } else {
-    hue = hue + 1;
-  }
+    leds[pos] = CHSV(hue, 240, 255);
+  }
+  hue += 1;
 }
 
 uint8_t numberOfWorms = 3;


  if (patternId == NIGHT_SPARKLES) {
    nightSparkles();
  } else if (patternId == BEAUTIFUL_SPARKLES || patternId == SINGLE_COLOR_SPARKLES) {
    sparkles();
  } else if (patternId == DISCO_BARBER_1 || patternId == DISCO_BARBER_2) {
    discoBarber();
  } else if (patternId == WORMS) {
    worms();
  }

  firstRun = false;

  show_at_max_brightness_for_power();
}

uint8_t wavebright = 255;                  // You can change the brightness of the waves/bars rolling across the screen.
#define qsubd(x, b)  ((x>b)?wavebright:0)  // Digital unsigned subtraction macro. if result <0, then => 0. Otherwise, take on fixed value.
#define qsuba(x, b)  ((x>b)?x-b:0)         // Analog Unsigned subtraction macro. if result <0, then => 0

#include "FastLED.h"
#define LED_DT 7              // Data pin to connect to the strip.
#define COLOR_ORDER GRB       // Are they RGB, GRB or what??
#define LED_TYPE WS2812B      // Don't forget to change LEDS.addLeds
#define NUM_LEDS 1500         // Number of LED's.
struct CRGB leds[NUM_LEDS];   // Initialize our LED array.
uint8_t max_bright = 255;     // Overall brightness definition. It can be changed on the fly.
unsigned long previousMillis; // Store last time the strip was updated.
int hue = 50;                 // Starting hue.
bool firstTimeRunningThroughPattern = false;

#define NIGHT_SPARKLES 1
#define BEAUTIFUL_SPARKLES 2
#define DISCO_BARBER_2 3
#define DISCO_BARBER_1 4
#define SINGLE_COLOR_SPARKLES 5
#define WORMS 6
#define PARTY 7
//#define SIREN 8
#define DISCO_TWIRL 8

int maxPatternId = 8;
int rotationInMillseconds = 20000; // 20 seconds for production

// Either A)
bool holdPattern = true;
int patternId = DISCO_TWIRL;
// OR B)
//bool holdPattern = false;
//int patternId = NIGHT_SPARKLES;

void setup() {
  delay(3000);
  Serial.begin(57600);
  LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER>(leds, NUM_LEDS);
  FastLED.setBrightness(max_bright);
  set_max_power_in_volts_and_milliamps(5, 12000);
  randomSeed(analogRead(0));
}

