cleaned up basic server/client code