 		digitalWrite(leds[1], HIGH);
 		//set current state to caution
 		currentRoomState = CAUTION;
-		returnCode = publish("state", "caution");
+		returnCode = publishToBroker("state", "caution");
 	}
 	//else if active button pressed
 	else if (newRoomState == ACTIVE) {

		digitalWrite(leds[0], HIGH);
		//set current state to active
		currentRoomState = ACTIVE;
		returnCode = publish("state", "active");
	}
	//if message publish not successful, error has occured
	//report an error until board restarted and problem fixed

/**
Publishes a message to the MQTT Broker
*/
int publishToBroker(char topic[11], char message[11]) {
	//initialise variables
	char topicBuffer[100];
	char messageBuffer[100];
