anchor.diff:              case orddict:filter(fun(Key, _Value) ->
                                           belongs_to_snapshot(Key, SnapshotTime) end, [H|T]) of
                   []->
  -                    {error,no_snapshot};
  +                    {ok, no_snapshot};
                   [H1|T1]->
                       {CommitTime, Snapshot} = lists:last([H1|T1]),
                       {ok, {CommitTime, Snapshot}}
  
positive.code:     {ok, ReadDC2} = internal_read(ignore, Key, Type, vectorclock:from_list([{DC1,0},{DC2,1}]), ignore, OpsCache, SnapshotCache),
      io:format("Result2 = ~p", [ReadDC2]),
      ?assertEqual(1, Type:value(ReadDC2)),
  
      
  
      {ok, Res2} = internal_read(ignore, Key, Type, vectorclock:from_list([{DC2,1}, {DC1,1}]), ignore, OpsCache, SnapshotCache),
      ?assertEqual(2, Type:value(Res2)),
      io:format("after making the second read: Opscache= ~p ~n SnapCache= ~p", [orddict:to_list(OpsCache), orddict:to_list(SnapshotCache)]).
      
  concurrent_write2_test() ->
      OpsCache = ets:new(ops_cache, [set]),
      SnapshotCache = ets:new(snapshot_cache, [set]),
      Key = mycount,
      Type = riak_dt_gcounter,
      DC1 = local,
      DC2 = remote,
      S1 = Type:new(),
  
      %% Insert one increment in DC1
      {ok,Op1} = Type:update(increment, a, S1),
      DownstreamOp1 = #clocksi_payload{key = Key,
                                       type = Type,
                                       op_param = {merge, Op1},
                                       snapshot_time = vectorclock:from_list([{DC1,0}, {DC2,0}]),
                                       commit_time = {DC1, 1},
                                       txid = 1
                                      },
      op_insert_gc(Key,DownstreamOp1, OpsCache, SnapshotCache),
      io:format("after inserting the first op: Opscache= ~p ~n SnapCache= ~p", [orddict:to_list(OpsCache), orddict:to_list(SnapshotCache)]),
      {ok, Res1} = internal_read(ignore, Key, Type, vectorclock:from_list([{DC2,1}, {DC1,0}]), ignore, OpsCache, SnapshotCache),
      ?assertEqual(1, Type:value(Res1)),
      io:format("after making the first read: Opscache= ~p ~n SnapCache= ~p", [orddict:to_list(OpsCache), orddict:to_list(SnapshotCache)]),
  
      %% Another concurrent increment in other DC
      {ok, Op2} = Type:update(increment, b, S1),
      DownstreamOp2 = #clocksi_payload{ key = Key,
  									  type = Type,
  									  op_param = {merge, Op2},
  									  snapshot_time=vectorclock:from_list([{DC1,0}, {DC2,0}]),
  									  commit_time = {DC2, 1},
  									  txid=2},
  
      %% Read snapshot including both increments
      op_insert_gc(Key,DownstreamOp2, OpsCache, SnapshotCache),
      io:format("after inserting the second op: Opscache= ~p ~n SnapCache= ~p", [orddict:to_list(OpsCache), orddict:to_list(SnapshotCache)]),
  
      {ok, Res2} = internal_read(ignore, Key, Type, vectorclock:from_list([{DC2,1}, {DC1,1}]), ignore, OpsCache, SnapshotCache),
      ?assertEqual(2, Type:value(Res2)),
      io:format("after making the second read: Opscache= ~p ~n SnapCache= ~p", [orddict:to_list(OpsCache), orddict:to_list(SnapshotCache)]),
  
      %% Read different snapshots
      {ok, ReadDC1} = internal_read(ignore, Key, Type, vectorclock:from_list([{DC1,0}, {DC2, 1}]), ignore, OpsCache, SnapshotCache),
      ?assertEqual(1, Type:value(ReadDC1)),
          io:format("Result1 = ~p", [ReadDC1]),
      {ok, ReadDC2} = internal_read(ignore, Key, Type, vectorclock:from_list([{DC1,1},{DC2,0}]), ignore, OpsCache, SnapshotCache),
      io:format("Result2 = ~p", [ReadDC2]),
      ?assertEqual(1, Type:value(ReadDC2)).
  
  -endif.
  
negative.code: 									  snapshot_time=vectorclock:from_list([{DC1,0}, {DC2,0}]),
  									  commit_time = {DC1, 1},
  									  txid=2},
  
      op_insert_gc(Key,DownstreamOp2, OpsCache, SnapshotCache),
      io:format("after inserting the second op: Opscache= ~p ~n SnapCache= ~p", [orddict:to_list(OpsCache), orddict:to_list(SnapshotCache)]),
  									  
  