 // #include "neopixel/neopixel.h"
 #include "neopixel.h"
 
-#define EEPROM_ADDR_PULSE_COUNT 1
-#define EEPROM_ADDR_MAX_PULSE_COUNT 2
-#define EEPROM_ADDR_PERCENT_FULL 3
+#define EEPROM_ADDR_T0 0
+#define EEPROM_ADDR_T1 20
+#define EEPROM_ADDR_T2 40
+
 #define PIXEL_TYPE WS2812B
 #define PIXEL_COUNT 14
 
+struct TapObject
+{
+  int pulseCount;
+  int maxPulseCount;
+  int instantPulseCount;
+  int previousPulseCount;
+  int flowing;
+  int percentFull;
+  int currentSecond;
+  int previousSecond;
+  int animationStep;
+  int flowPin;
+  int ledPin;
+};
+
+//initialize taps
+TapObject T0 = {1000, 1000, 0, 0, 0, 100, 1, 0, 0, D6, D3};
+TapObject T1 = {1000, 1000, 0, 0, 0, 100, 1, 0, 0, D5, D2};
+TapObject T2 = {1000, 1000, 0, 0, 0, 100, 1, 0, 0, D4, D1};
+
 int ledPin = D7;
 
-int flowTapPin0 = D6;
-int flowTapPin1 = D5;
-int flowTapPin2 = D4;
-
-int ledTapPin0 = D3;
-int ledTapPin1 = D2;
-int ledTapPin2 = D1;
-
-Adafruit_NeoPixel stripT0 = Adafruit_NeoPixel(PIXEL_COUNT, ledTapPin0, PIXEL_TYPE);
-Adafruit_NeoPixel stripT1 = Adafruit_NeoPixel(PIXEL_COUNT, ledTapPin1, PIXEL_TYPE);
-Adafruit_NeoPixel stripT2 = Adafruit_NeoPixel(PIXEL_COUNT, ledTapPin2, PIXEL_TYPE);
+Adafruit_NeoPixel stripT0 = Adafruit_NeoPixel(PIXEL_COUNT, T0.ledPin, PIXEL_TYPE);
+Adafruit_NeoPixel stripT1 = Adafruit_NeoPixel(PIXEL_COUNT, T1.ledPin, PIXEL_TYPE);
+Adafruit_NeoPixel stripT2 = Adafruit_NeoPixel(PIXEL_COUNT, T2.ledPin, PIXEL_TYPE);
 
 int flowTapPin0Value = 0;
 int flowTapPin1Value = 0;
 int flowTapPin2Value = 0; 
 
-//tap 0 values
-int instantPulseCountT0 = 0;
-int previousPulseCountT0 = 0;
-int flowingT0 = 0;
-int pulseCountT0 = 200;
-int maxPulseCountT0 = 200; //calibration value
-
-//tap 1 values
-int instantPulseCountT1 = 0;
-int previousPulseCountT1 = 0;
-int flowingT1 = 0;
-int pulseCountT1 = 200;
-int maxPulseCountT1 = 200; //calibration value
-
-//tap 3 values
-int instantPulseCountT2 = 0;
-int previousPulseCountT2 = 0;
-int flowingT2 = 0;
-int pulseCountT2 = 200;
-int maxPulseCountT2 = 200; //calibration value
-
-int percentFullT0 = 100;
-int percentFullT1 = 100;
-int percentFullT2 = 100;
-
-int currentSecondT0 = 1;
-int previousSecondT0 = 0;
-int animationStepT0 = 0;
-int currentSecondT1 = 1;
-int previousSecondT1 = 0;
-int animationStepT1 = 0;
-int currentSecondT2 = 1;
-int previousSecondT2 = 0;
-int animationStepT2 = 0;
-
 String *strArr = new String[20];
-
-const char* flowTapPin0Name = "flowTapPin0Val";
-const char* flowTapPin1Name = "flowTapPin1Val";
-const char* flowTapPin2Name = "flowTapPin2Val";
 
 int handlePost(String command);
 

  // percentFull = EEPROM.read(EEPROM_ADDR_PERCENT_FULL);

  //https://api.particle.io/v1/devices/<device_id>/<variable_name>?access_token=<access_token>
  Particle.variable("maxPCntT0", &maxPulseCountT0, INT);
  Particle.variable("instPCntT0", &instantPulseCountT0, INT);
  Particle.variable("pulseCntT0", &pulseCountT0, INT);
  Particle.variable("perFullT0", &percentFullT0, INT);

  Particle.variable("maxPCntT1", &maxPulseCountT1, INT);
  Particle.variable("instPCntT1", &instantPulseCountT1, INT);
  Particle.variable("pulseCntT1", &pulseCountT1, INT);
  Particle.variable("perFullT1", &percentFullT1, INT);

  // Particle.variable("maxPCntT2", &maxPulseCountT2, INT);
  // Particle.variable("instPCntT2", &instantPulseCountT2, INT);

  return 1;
}

void pinValT0()
{
  if(digitalRead(T0.flowPin) == HIGH)
  {
    if(flowTapPin0Value == 0)
    {
