updated server code and added some client code