rought sketch of client code