anchor.diff:      accept_val = new_buffer() :: buffer(),
       active = false :: boolean(),
   
  +    %%% management of pending cmds to notify clients
  +    to_notify_pending = [] :: [notify_cmd()], %% list before they are included in accept_val
  +    wait_for_learned = dict:new() :: dict:dict(cmd_id(), [notify_cmd()]),
  +
  +    %% CRDT managment
       crdt_type = null :: null | crdt:crdt_module(),
       cmd_set = new_buffer() :: buffer(),
       crdt = null :: null | crdt:crdt(),
  +
  +    %% loop variables for agreement loop
  +    loop_val = new_buffer :: buffer(),
  +    loop_iter = 0 :: non_neg_integer(),
       replies = #replies{} :: #replies{} | done,
   
  -    loop_val = null :: buffer(),
  -    loop_iter = null :: non_neg_integer(),
  -
  +    %% for waiting in prop functions
       prop_wait_list = [] :: [tuple()]
     }).
   
  -%% More sensible management of query commands... these do not have to be sent
  +%% TODO More sensible management of query commands... these do not have to be sent
   %% to remotely as they are noops for updates?
  -
  --type buffer() :: set:sets(buffer_element()).
  --type buffer_element() ::
  -  {comm:mypid(),
  -    {qfun, crdt:query_fun() | [crdt:query_fun()]}
  -    | [crdt:update_fun()]}.
  +-type client() :: {any(), any()}. %% reqid and pid
  +-type notify_cmd() :: {client(), query_cmd() | notify_ok}.
  +
  +-type buffer() :: set:sets(cmd()).
  +-type cmd() :: {cmd_id(), query_cmd() | update_cmd() | noop}.
  +
  +-type cmd_id() :: any().
  +-type query_cmd() :: {qfun, crdt:query_fun() | [crdt:query_fun()]}.
  +-type update_cmd() :: crdt:update_fun() | [crdt:update_fun()].
  +
   
   %% initialize: return initial state.
   -spec init(atom() | tuple()) -> state().
  
positive.code: -spec is_subset(buffer(), buffer()) -> boolean().
  is_subset(A, B) -> sets:is_subset(A, B).
  
  -spec union([buffer()]) -> buffer().
  union(ListOfBuffers) -> sets:union(ListOfBuffers).
  
  
negative.code: -spec check_config() -> boolean().
  check_config() -> true.
  
  %%%%%%%%%%%%%%%%%%%%%
  %% Application of learned functions on the CRDT
  %%%%%%%%%%%%%%%%%%%%%
  print_pstate(Key, PState) ->
    print_pstate("", Key, PState).
  print_pstate(_Msg, _Key, _PState) ->
    ?TRACE(
      "Msg: ~p~n"
      "Key:~p~n~n" ++
  