added server and client code