 int stateInPacket = 0; //to move in their bit pattern 
 int sysdalarmValue = 2; //to tell IFTTT if system is armed or not
 bool DEBUG = FALSE;
+int values[500] = {0};
+int position = 0;//position in the list
+int lastRead = 0;//position to read in the list
+int lastData = 0;//EPOCH value
+String dataValues = "";
 
 void setup() {
     Serial1.begin(9600);
+    Particle.variable("lastRead",lastRead);
+    Particle.variable("lastData",lastData);
+    Particle.variable("dataValues",dataValues);
+    Particle.function("UpdateString", updateString);
     Particle.function("ArmedStatus", getStatus);
     if (DEBUG){
         Serial.begin(9600);

void sendAlarm() {
    Particle.publish("ALARM");
}


void loop() {
    if (Serial1.available() > 0) {
        values[position] = (Serial1.read());
        position ++;
        if(position == 500)
            cleanoutList();
    }
    else{
        if (position > lastRead) {
            handleData(values[lastRead]);
            lastRead ++;
            lastData = Time.now();
        }
        
    }
}

//Handle all the actual data from the system
