minor modifications to the client code, starting the work in the threaded version