   if (faderate == 100 || faderate == 200) {
     numdots += 1;
   }
-  
+
   fadeToBlackBy(leds, NUM_LEDS, faderate);
-  
+
   for ( int i = 0; i < numdots; i++) {
     for ( int j = 0; j < 20; j++) {
       leds[beatsin16(basebeat + i + numdots, 0, NUM_LEDS - 20) + j] += CHSV(curhue, 240, 255); //beat16 is a FastLED 3.1 function

    allfreq = 3;
    thisphase += 48;
  }
  
  hue = hue + 1;                                                // Hue rotation is fun for thiswave.

  for (int k = 0; k < NUM_LEDS - 1; k++) {                                    // For each of the LED's in the strand, set a brightness based on a wave as follows:

int numberOfSparkles = 1;
int increasing = true;

int upAndDownBy(int value, int difference) {
  if (value < 80 && increasing) {
    value += difference;
  } else if (value > 5) {
    value -= difference;
    increasing = false;
  } else {
    increasing = true;
    value += difference;
  }
  return value;
}

void nightSparkles() {
  fadeToBlackBy(leds, NUM_LEDS, 180);
  numberOfSparkles = upAndDownBy(numberOfSparkles, 1);
  for (int i = 0; i < 20; i++) {
    int pos = random16(NUM_LEDS);
    leds[pos] = CHSV(hue, 180, 255);
  }
  for (int i = 0; i < numberOfSparkles * 4; i++) {
    leds[random16(NUM_LEDS)] += CHSV(hue, 200, 20);
  }
  hue = hue + 1;
}

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;
