 		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) {

//MQTT constants
#define MQTTCLIENT_QOS2 1
const char* mainTopic = "londonbridge";
MQTT::QoS qos = MQTT::QOS2;
bool retained = true;

//Room State

		}
		//set current state to inactive
		currentRoomState = INACTIVE;
		returnCode = publishToBroker("state", "inactive");
	}
	//else if emergency button pressed
	else if (newRoomState == EMERGENCY) {
