anchor.diff:      case ets:lookup(OpsCache, Key) of
          [] ->
               {ok, LatestSnapshot};
  -	[{_, Ops}] ->
  -	    case length(Ops) of
  +	[{_, {Length,Ops}}] ->
  +	    case Length of
   		0 ->
   		    {ok, LatestSnapshot};
   		_Len ->
  
positive.code: %% the GC mechanism.
  -spec op_insert_gc(key(), clocksi_payload(), cache_id(), cache_id()) -> true.
  op_insert_gc(Key, DownstreamOp, OpsCache, SnapshotCache)->
      OpsDict = case ets:lookup(OpsCache, Key) of
                    []->
                        [];
                    [{_, Dict}]->
                        Dict
                end,
      case (length(OpsDict))>=?OPS_THRESHOLD of
          true ->
              Type=DownstreamOp#clocksi_payload.type,
              SnapshotTime=DownstreamOp#clocksi_payload.snapshot_time,
              {_, _} = internal_read(Key, Type, SnapshotTime, ignore, OpsCache, SnapshotCache),
  	    %% Have to get the new ops dict because the interal_read can change it
  	    OpsDict1 = case ets:lookup(OpsCache, Key) of
  	    		  []->
  	    		      [];
  	    		  [{_, ADict}]->
  	    		      ADict
  	    	       end,
              OpsDict2=[DownstreamOp|OpsDict1],
              ets:insert(OpsCache, {Key, OpsDict2});
          false ->
              OpsDict1=[DownstreamOp|OpsDict],
              ets:insert(OpsCache, {Key, OpsDict1})
      end.
  
  
  
negative.code:                          cache_id(),cache_id() ) -> true.
  snapshot_insert_gc(Key, SnapshotDict, SnapshotCache, OpsCache)->
      %% Should check op size here also, when run from op gc
      case (vector_orddict:size(SnapshotDict))>=?SNAPSHOT_THRESHOLD of
          true ->
  	    %% snapshots are no longer totally ordered
  	    PrunedSnapshots=vector_orddict:sublist(SnapshotDict, 1, ?SNAPSHOT_MIN),
              FirstOp=vector_orddict:last(PrunedSnapshots),
              {CommitTime, _S} = FirstOp,
  	    {Length,OpsDict} = case ets:lookup(OpsCache, Key) of
  			  []->
  			      {0,[]};
  			  [{_, {Len,Dict}}]->
  			      {Len,Dict}
  		      end,
              {NewLength,PrunedOps}=prune_ops({Length,OpsDict}, CommitTime),
              ets:insert(SnapshotCache, {Key, PrunedSnapshots}),
              true = ets:insert(OpsCache, {Key, {NewLength,PrunedOps}});
          false ->
              true = ets:insert(SnapshotCache, {Key, SnapshotDict})
      end.
  
  %% @doc Remove from OpsDict all operations that have committed before Threshold.
  -spec prune_ops({non_neg_integer(),list()}, snapshot_time())-> {non_neg_integer,list()}.
  prune_ops({_Len,OpsDict}, Threshold)->
  %% should write custom function for this in the vector_orddict
  %% or have to just traverse the entire list?
  %% since the list is ordered, can just stop when all values of
  