implements client program.
modified server and client.
modified client and server.