completed Client.java, waiting for testing to ensure correctness