             // only alarm if we're past the debounce interval
             int now = Time.now();
             if (now - lastStateSwitchTime > DEBOUNCE_SECONDS) {
-                alarmState = 0;    
+                alarmState = 0;
                 lastStateSwitchTime = now;
-                Spark.publish("water_alarm", "off", 60, PRIVATE);
+                Particle.publish("water_alarm", "off", 60, PRIVATE);
             }
         }
     }
-}
-
-// initialize our pins
-void pins_init() {
-    pinMode(LED, OUTPUT);
-    pinMode(WATER_SENSOR, INPUT);
 }
 
 // determine if we're exposed to water or not

            if (now - lastStateSwitchTime > DEBOUNCE_SECONDS) {
                alarmState = 1;
                lastStateSwitchTime = now;
                Spark.publish("water_alarm", "on", 60, PRIVATE);
            }
        }
    } else {

// Functions
//

// Particle setup
void setup() {
    // initialize our pins I/O
    pinMode(LED, OUTPUT);
    pinMode(WATER_SENSOR, INPUT);

    // tell the world we're online
    Particle.publish("online");

    // publish the water variable
    Particle.variable("water", &water, INT);

    // publish the alarm state variable
    Particle.variable("alarmState", &alarmState, INT);
}

// Spark loop
