client and server code added; now it is organized; BSD license