anchor.diff:              false
       end.
   
  -%% @doc Garbage collection triggered by reads.
  +%% @doc Operation to insert a Snapshot in the cache and start 
  +%%      Garbage collection triggered by reads.
  +-spec snapshot_insert_gc(Key::term(), SnapshotDict::orddict:orddict(), 
  +	OpsDict::orddict:orddict(), atom() , atom() ) -> true.
   snapshot_insert_gc(Key, SnapshotDict, OpsDict, SnapshotCache, OpsCache)-> 
   	case (orddict:size(SnapshotDict))==?SNAPSHOT_THRESHOLD of 
   	true ->
  
positive.code: %% the mechanism is very simple; when there are more than OPS_THRESHOLD
  %% operations for a given key, just perform a read, that will trigger
  %% the GC mechanism.
  
  op_insert_gc(Key,DownstreamOp, OpsDict, OpsCache, SnapshotCache)-> 
      case (orddict:size(OpsDict))>=?OPS_THRESHOLD of 
      true ->
  	    lager:info("too many operations: time to GC: ~p"),
  	    Type=DownstreamOp#clocksi_payload.type,
  	    SnapshotTime=DownstreamOp#clocksi_payload.snapshot_time,
  	    lager:info("redading key: ~p ~n type: ~p ~n snapshot time: ~p", [Key, Type, SnapshotTime]),
  
negative.code: 		PrunedOps=prune_ops(OpsDict, CommitTime),
  		%lager:info("Result is: ~p",[PrunedOps]),
  		ets:insert(SnapshotCache, {Key, PrunedSnapshots}),
          ets:insert(OpsCache, {Key, PrunedOps});
  	false ->
  		ets:insert(SnapshotCache, {Key, SnapshotDict})
  		%lager:info("NO NEED OF pruning the following snapshot cache: ~p",[SnapshotDict]),
  	end.
  	
  %% @doc Remove from OpsDict all operations that have committed before Threshold. 
  -spec prune_ops(orddict:orddict(), {Dc::term(),CommitTime::non_neg_integer()})-> orddict:orddict().	
  prune_ops(OpsDict, Threshold)->
  	orddict:filter(fun(_Key, Value) -> 
  				%lager:info("This is the operation to analyse: ~n ~p", [Value]),
  