Did part 2 for client.java