anchor.diff:  -spec tuple_to_key(tuple()) -> {any(),non_neg_integer(),non_neg_integer(),list()}.
   tuple_to_key(Tuple) ->
       Key = element(1, Tuple),
  -    Length = element(2, Tuple),
  +    {Length,ListLen} = element(2, Tuple),
       OpId = element(3, Tuple),
       Ops = tuple_to_key_int(?FIRST_OP,Length+?FIRST_OP,Tuple,[]),
  -    {Key,Length,OpId,Ops}.
  +    {Key,Length,OpId,ListLen,Ops}.
   tuple_to_key_int(Next,Next,_Tuple,Acc) ->
       Acc;
   tuple_to_key_int(Next,Last,Tuple,Acc) ->
  
positive.code: -include("antidote.hrl").
  -include_lib("riak_core/include/riak_core_vnode.hrl").
  
  
  -define(SNAPSHOT_THRESHOLD, 10).
  -define(SNAPSHOT_MIN, 3).
  -define(OPS_THRESHOLD, 50).
  -define(FIRST_OP, 4).
  
  -ifdef(TEST).
  -include_lib("eunit/include/eunit.hrl").
  
negative.code: op_insert_gc(Key, DownstreamOp, OpsCache, SnapshotCache)->
      case ets:member(OpsCache, Key) of
  	false ->
  	    ets:insert(OpsCache, erlang:make_tuple(?FIRST_OP+?OPS_THRESHOLD,0,[{1,Key},{2,{0,?OPS_THRESHOLD}}]));
  	true ->
  	    ok
      end,
      NewId = ets:update_counter(OpsCache, Key,
  			       {3,1}),
      {Length,ListLen} = ets:lookup_element(OpsCache, Key, 2),
      case (Length)>=ListLen of
          true ->
              Type=DownstreamOp#clocksi_payload.type,
              SnapshotTime=DownstreamOp#clocksi_payload.snapshot_time,
              {_, _} = internal_read(Key, Type, SnapshotTime, ignore, OpsCache, SnapshotCache, true),
  	    %% Have to get the new ops dict because the interal_read can change it
  	    Length1 = ets:lookup_element(OpsCache, Key, 2),
  	    true = ets:update_element(OpsCache, Key, [{Length1+?FIRST_OP,{NewId,DownstreamOp}}, {2,{Length1+1,ListLen}}]);
          false ->
  	    true = ets:update_element(OpsCache, Key, [{Length+?FIRST_OP,{NewId,DownstreamOp}}, {2,{Length+1,ListLen}}])
      end.
  
  
  