 /* Predeclarations */
 // Necessary to avoid confusing particle's preprocessor
 // see https://docs.particle.io/reference/firmware/core/#preprocessor
+void dark_tick(Ticker *t, unsigned long tick);
+void random_tick(Ticker *t, unsigned long tick);
 void colorwheel_tick(Ticker *t, unsigned long tick);
-void cycling_tick(Ticker *t, unsigned long tick);
-void fading_cycling_tick(Ticker *t, unsigned long tick);
 void targeted_tick(Ticker *t, unsigned long tick);
-void dark_tick(Ticker *t, unsigned long tick);
+void hsv_targeted_tick(Ticker *t, unsigned long tick);
+
 TickerRgb hsv2rgb(double hue, double sat, double value);
 
 /* Define Objects */
 ShiftBrite sb(NUM_LEDS, LATCH_PIN);
+//TODO: see if this works
+//Ticker Tickers[NUM_LEDS];
 Ticker Tickers[NUM_LEDS] = {
 	Ticker(&dark_tick, 0, 0,  0),
 	Ticker(&dark_tick, 0, 0,  0),

	for (int i = 0; i < NUM_LEDS; ++i) {
		Tickers[i] = Ticker(&targeted_tick, 3, 0, i * 5 + 1);

		Tickers[i].targets[0] = {red: random(0,1023), green: random(0,1023), blue: random(0,1023)};
		Tickers[i].targets[1] = {red: 0, green: 0, blue: 511};
		Tickers[i].targets[2] = {red: 1023, green: 1023, blue: 1023};
	}
}

void mode_sparkle()
{
	for (int i = 0; i < NUM_LEDS; ++i) {
		Tickers[i] = Ticker(&random_tick, 0, 2, i);
	}
}

void mode_christmas_lights()
{
	for (int i = 0; i < NUM_LEDS; ++i) {
		// Slow by 2^6
		Tickers[i] = Ticker(&cycling_tick, 4, 6, i);

		//TODO: Adjust these values to taste to simulate christmas lights
		Tickers[i].targets[0] = {red: 1023, green:    0, blue:    0}; // Red
		Tickers[i].targets[1] = {red: 1023, green: 1023, blue:    0}; // Yellow
		Tickers[i].targets[2] = {red:    0, green: 1023, blue:    0}; // Green
		Tickers[i].targets[3] = {red:    0, green:    0, blue: 1023}; // Blue
	}
}

void mode_christmas()
{
	for (int i = 0; i < NUM_LEDS; ++i) {
		// Slow by 2^6
		Tickers[i] = Ticker(&cycling_tick, 2, 6, i);

		Tickers[i].targets[0] = {red: 1023, green:    0, blue:    0}; // Red
		Tickers[i].targets[1] = {red:    0, green: 1023, blue:    0}; // Green
	}
}


unsigned long tick_delay  = 1000 / TPS;
unsigned long tick, last_tick, last_frame = 0;

/* Switch to switch modes */
int current_mode = 0;
volatile int           mode_change_requested = 0;
volatile unsigned long switch_last_triggered = 0;

void setup()
{
