Implementing the client protocol