rewrite client.java
propagate function added, some print details need to add.