small changes and a bug fix

run some tests, found a bug, fixed it.
please keep the current file names
updated to doc file
need to find out: is it okay if server closes, client will exit only
after it read input from user.
DAVID: run tests