 Heartbeat hb;
 LedSerialMaster led(&Serial, MAX_CLIENTS);
 
-
-std::pair<int, WiFiClient> *unAuthClients;
+long uuid;
+
+
+
+//enum for what an authednticated client is waiting to recieve next
+enum connStatusEnum
+{
+	NOT_CONNECTED,
+	FIRST_CONNECT,
+	MAGIC_BYTE_RX,
+	CLIENT_ID_RX,
+	CONNECTED
+};
+
+enum unAuthEnum
+{
+	timeIn,
+	authProg,
+	unAuthClient
+};
+//Tracking unauthenticated connections,
+//@1st, int = time connected in micros
+//@2nd, connStatusEnum = what stage in connection the unAuthClient is in
+//@3rd, WiFIClient = unAuthClient in question
+std::tuple<uint, connStatusEnum, WiFiClient> *unAuthClients;
 
 int nextFreeSpot = 0;
 

		
		
		//uint8_t msgBuffer[256];
		sbuf[0] = c->read();
		sbuf[1] = c->read();
		short msgLen = (sbuf[0] << 8 |sbuf[1]);
		//Fixed read in length here, huge speed increase due to fixing timeout!
		c->readBytes(&sbuf[2], msgLen);

		long source = (sbuf[2] << 56 | sbuf[3] << 48 | sbuf[4] << 40 | sbuf[5] << 32 | sbuf[6] << 24 | sbuf[7] << 16 | sbuf[8] << 8 | sbuf[9]);
		long dest = (sbuf[10] << 56 | sbuf[11] << 48 | sbuf[12] << 40 | sbuf[13] << 32 | sbuf[14] << 24 | sbuf[15] << 16 | sbuf[16] << 8 | sbuf[17]);
		short func = (sbuf[18] << 8 | sbuf[19]);
		short size = (sbuf[20] << 8 | sbuf[21]);
		uint8_t * data = new uint8_t[size];
		memcpy(data, &sbuf[22], size);

		//data is now stored inside DataCapsule, data can be freed
		DataCapsule capsule(source, dest, func, size, data);
		Serial.print("MEssage recieved from ");
		Serial.println(capsule.getSource());

		delete data;

iota::Map<long, WiFiClient*> *clientMap;

static const size_t bufferSize = 1024;
static uint8_t rxBuf[bufferSize];
static uint8_t txBuf[bufferSize];

std::pair<int, int> tMarkers;




void setup() {
