implemeted the response part of the protocol.