completed first function for secret handshake