handshake fully implemented