Added initial 3 way handshake functionality