Implemented handshake protocol