anchor.diff:  				     end, CT, vector_orddict:to_list(PrunedSnapshots)),
   	    {Key,Length,OpId,ListLen,OpsDict} = case ets:lookup(OpsCache, Key) of
   						    [] ->
  -							{Key, 0, 0, 0, []};
  +							{Key, 0, 0, 0, {}};
   						    [Tuple] ->
  -							tuple_to_key(Tuple,true)
  +							tuple_to_key(Tuple,false)
   						end,
               {NewLength,PrunedOps}=prune_ops({Length,OpsDict}, CommitTime),
               true = ets:insert(SnapshotCache, {Key, PrunedSnapshots}),
  
positive.code:     Acc;
  tuple_to_key_int(Next,Last,Tuple,Acc) ->
      tuple_to_key_int(Next+1,Last,Tuple,[element(Next,Tuple)|Acc]).
  
  %% This is an internal function used to filter ops and reverse the list
  %% It returns a tuple where the first element is the lenght of the list returned
  %% The elements in the list also include the location that they will be placed
  %% in the tuple in the ets table, this way the list can be used
  %% directly in the erlang:make_tuple function
  -spec reverse_and_filter(fun(),list(),non_neg_integer(),list()) -> {non_neg_integer(),list()}.
  reverse_and_filter(_Fun,[],Id,Ops) ->
      %% Add the index to say what position the ops will be in the tuple
      {_, OpsWithId} = 
  	lists:foldl(fun({_,Op},{NewId,Acc}) ->
  			    {NewId+1,[{NewId,Op}|Acc]}
  		    end, {?FIRST_OP,[]}, Ops),
      {Id-?FIRST_OP,OpsWithId};
  reverse_and_filter(Fun,[First|Rest],Id,Acc) ->
      case Fun(First) of
  	true ->
  	    reverse_and_filter(Fun,Rest,Id+1,[{Id,First}|Acc]);
  	false ->
  	    reverse_and_filter(Fun,Rest,Id,Acc)
      end.
  
  %% @doc Insert an operation and start garbage collection triggered by writes.
  %% the mechanism is very simple; when there are more than OPS_THRESHOLD
  
negative.code:          encode_handoff_item/2,
           handle_coverage/4,
           handle_exit/3]).
  
  -type op_and_id() :: {non_neg_integer(),#clocksi_payload{}}.
  
  -record(state, {
  	  partition :: partition_id(),
  