anchor.diff:              {ok, MVReg}
       end;
   
  -%% @doc Assign the value without providing timestamp. The vector clock
  -%% of the register will be incremented by one for the corresponding actor.
  -update({assign, Value}, Actor, MVReg) ->
  -    VV = incVV(MVReg, Actor),
  -    NewMVReg = [{Value, VV}],
  -    {ok, NewMVReg};
  -
  -%% @doc Propagate is used in case of non-linealizable update. The update
  -%% provides the value and the vector clock for this update. The vector clock
  -%% is supposed to be a single clock instead of a list, since update will combine
  -%% all vector clocks into a single one. All compatible vector clocks (descendent) will be merged;
  -%% non-compatible vector clocks will be kept in a list.
  +%% @doc Propagate the `Value' of a `mvreg()' to other replicas. 
  +%% The `Value' and its vector clock `TS' is the parameter. It is assumed that
  +%% propagation only happens after one update is applied, therefore `Value' is a single term and 
  +%% `TS' can only be one vector clock.
  +%% All compatible vector clocks (being descendent of another) will be merged;
  +%% non-compatible vector clocks will be kept in a list. 
  +%% Corresponding values of non-compatible vector clocks will also be kept.
   update({propagate, Value, TS}, _, MVReg ) ->
  -    case is_dominated(value(timestamp, MVReg), TS) of 
  +    case if_dominate(value(timestamp, MVReg), TS) of 
           true ->
               {ok, MVReg};
           false ->
  
positive.code:     NewVC = riak_dt_vclock:increment(Actor, MaxVC),
      NewVC.
  
  %% @doc If the timestamp is larger than all corresponding entries.
  dominate_ts(_TS, _Actor, []) ->
      true;
  dominate_ts(TS, Actor, [H|T]) ->
      {_Value, VC} = H,
      OldTS = riak_dt_vclock:get_counter(Actor, VC),
      if  TS > OldTS ->
          dominate_ts(TS, Actor, T);
      true ->
          false
      end.
  
negative.code:     {ok, MVRA1_1} = update({assign, value1}, actor1, MVRA1_0),
      %% Propagate a timestamp that is not compatible with the current ones
      {ok, MVRMerge1} = update({propagate, value2, VCA2}, nothing, MVRA1_1),
      ?assertEqual(lists:sort([value1, value2]), lists:sort(value(MVRMerge1))),
      ?assertEqual(lists:sort([VCA1, VCA2]), lists:sort(value(timestamp, MVRMerge1))),
      VCA12 = riak_dt_vclock:increment(actor2, VCA1),
      %% Propagate a timestamp that dominates all current ones
      {ok, MVRMerge2} = update({propagate, value2, VCA12}, nothing, MVRMerge1),
      ?assertEqual([value2], value(MVRMerge2)),
      ?assertEqual([VCA12], value(timestamp, MVRMerge2)),
      %% Propagate a timestamp that is dominated by the current one
      {ok, MVRMerge3} = update({propagate, value3, VCA1}, nothing, MVRMerge2),
      ?assertEqual([value2], value(MVRMerge3)),
      ?assertEqual([VCA12], value(timestamp, MVRMerge3)).
      
  %% Test if a diverged MVReg merges all timestamp after being updated.
  update_assign_diverge_test() ->
  