Implemented all of the protocol steps