   return palette[random(NPRETTY_COLORS)];
 }
 
-int do_random(){
+void do_random(){
   push_color(random_color());
 }
 
-int do_mirror(){
+void do_mirror(){
   for(int i = 0; i < LED_COUNT / 2; i++){
     colors[LED_COUNT - i - 1] = colors[i];
     effects[LED_COUNT - i - 1] = effects[i];
   }
 }
 
+void do_repeat(){
+  push_color(colors[0]);
+  effects[0] = effects[1];
+}
+
 void setup_buffer(){
   for(int i = 0; i < LED_COUNT; i++){
-    if(effects[i] == BLINK_ON){
-      if(blink_state){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BLINK_ON_1){
-      if(blink_state_1){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BLINK_ON_2){
-      if(blink_state_2){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BLINK_ON_3){
-      if(blink_state_3){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BLINK_ON_4){
-      if(blink_state_4){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BLINK_ON_5){
-      if(blink_state_5){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BLINK_ON_6){
-      if(blink_state_6){
-        render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE); 
-      } else {
-        render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
-      }
-    } else if(effects[i] == BREATHE_ON){
-      render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE * breathe_steps[BREATHE_MAX_STEP - breathe_step]);
-    } else if(effects[i] == STATIC_ON){
-      render[i] = random_color();
-    } else {
-      render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE);
-    }
+    int effect = effects[i];
+
+    if(effect ==  STATIC_ON) colors[i] = random_color();
+
+    if(effect >= BLINK_MIN && effect <= BLINK_MAX){
+      if((effect == BLINK_ON && blink_state) || 
+            (effect == BLINK_ON_1 && blink_state_1) || 
+            (effect == BLINK_ON_2 && blink_state_2) || 
+            (effect == BLINK_ON_3 && blink_state_3) || 
+            (effect == BLINK_ON_4 && blink_state_4) || 
+            (effect == BLINK_ON_5 && blink_state_5) || 
+            (effect == BLINK_ON_6 && blink_state_6) || 
+            (effect == BLINK_ON_A && blink_state_a) || 
+            (effect == BLINK_ON_B && blink_state_b)) {
+          render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE);  
+        } else {
+          render[i] = scale_color(colors[i], MINIMUM_BRIGHTNESS_SCALE);
+        }
+    }
+    
+    else if(effects[i] == BREATHE_ON) render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE * breathe_steps[BREATHE_MAX_STEP - breathe_step]);
+
+    else render[i] = scale_color(colors[i], DEFAULT_BRIGHTNESS_SCALE);
   }
 }
 

  0.0,
  0.0,  // a few extra make it feel more natural
  0.0,
//  0.0,
//  0.0,
  0,0
};


}

#define NO_STATE 0
#define BREATHE_ON 1

#define BLINK_ON 2

// blink group 1-6
#define BLINK_ON_1 11
#define BLINK_ON_2 12
#define BLINK_ON_3 13
