 	String status;
 
 	if (on_or_off){
+        // turn other zones off
+        zones_all_off("");
+        
 		status = "on";
         digitalWrite(zones[zone_number-1], HIGH);
 	} else {

	return on_or_off;
}

int zones_all_off(){
	// turn all zones off

	Particle.publish("striide.garden.all_off");
    for (int i = 0; i < num_of_zones; i++){
		digitalWrite(zones[i], LOW);
	}
}

// ************************* TIME FUNCTIONS *************************

void set_time_zone(float offset){
	// set the current time zone
	Time.zone(offset);
}

bool check_sync_timer(){
	// check if 24 hours have passed
	if (millis() - last_cloud_time_sync > ONE_DAY_MILLIS) {
		return true;
	} else {
		return false;
	}
}

void sync_time_with_cloud(){
	// update current time on microprocessor
// 	Particle.syncTime();
	last_cloud_time_sync = millis();

	Particle.publish("striide.garden.runzone");
}

#define ZONE2 D4
#define ZONE3 D5
#define ZONE4 D6
#define NUM_ZONES 4

// ************************* VARIABLES *************************

unsigned long last_cloud_time_sync = millis();
byte zone_state_array[NUM_ZONES] = {0,0,0,0};
byte zones[NUM_ZONES] = {ZONE1, ZONE2, ZONE3, ZONE4};
byte test_timer = 20;	// seconds for "relay test heartbeat timer"


void setup() {

	// pin setup and initialization
	for (int i = 0; i < NUM_ZONES; i++){
		pinMode(zones[i], OUTPUT);
		digitalWrite(zones[i], LOW);
	}
