anchor.diff:              	ets:insert(SnapshotCache, {Key, orddict:store(CommitTime,Snapshot, SnapshotDict)})
               end;
           [{_, SnapshotDict}] ->
  -			{ok, {SnapshotCommitTime, LatestSnapshot}} = get_latest_snapshot(SnapshotDict, SnapshotTime),
  +			{ok, {_SnapshotCommitTime, LatestSnapshot}} = get_latest_snapshot(SnapshotDict, SnapshotTime),
   		    %lager:info("materialiser_vnode: Latest snapshot for key ~p is ~p, with commit time ~p.",[Key, LatestSnapshot, SnapshotCommitTime]),
               case ets:lookup(OpsCache, Key) of
               [] ->
               	Snapshot=LatestSnapshot;
               [{_, OpsDict}] ->
  -            	lager:info("materialiser_vnode: about to filter OpsDict= ~p",[OpsDict]),
  +            	%lager:info("materialiser_vnode: about to filter OpsDict= ~p",[OpsDict]),
               	{ok, Ops}= filter_ops(OpsDict),
  -            	lager:info("materialiser_vnode: Ops to apply are: ~p",[Ops]),
  +            	%lager:info("materialiser_vnode: Ops to apply are: ~p",[Ops]),
               	case Ops of
               	[]->
               	    Snapshot=LatestSnapshot;
  
positive.code: -include_lib("riak_core/include/riak_core_vnode.hrl").
  
  
  -define(SNAPSHOT_THRESHOLD, 3).
  -define(SNAPSHOT_MIN, 2).
  -define(OPS_THRESHOLD, 50).
  -define(OPS_MIN, 5).
  
negative.code: snapshot_insert_gc(Key, SnapshotDict, OpsDict, SnapshotCache, OpsCache)-> 
  	case (orddict:size(SnapshotDict))==?SNAPSHOT_THRESHOLD of 
  	true ->
  		%lager:info("pruning the following snapshot cache: ~p",[SnapshotDict]),
  		PrunedSnapshots=orddict:from_list(lists:sublist(orddict:to_list(SnapshotDict), 1+?SNAPSHOT_THRESHOLD-?SNAPSHOT_MIN, ?SNAPSHOT_MIN)),
  		%lager:info("Result is: ~p",[PrunedSnapshots]),
  		FirstOp=lists:nth(1, PrunedSnapshots),
  		{CommitTime, _S} = FirstOp,
  		%lager:info("pruning the following OPERATIONS cache before commit time: ~p ~n ~p",[CommitTime,OpsDict]),
  		PrunedOps=prune_ops(OpsDict, CommitTime),
  		%lager:info("Result is: ~p",[PrunedOps]),
  		ets:insert(SnapshotCache, {Key, PrunedSnapshots}),
          ets:insert(OpsCache, {Key, PrunedOps}),
          true;
  	false ->
  		ets:insert(SnapshotCache, {Key, SnapshotDict}),
  		%lager:info("NO NEED OF pruning the following snapshot cache: ~p",[SnapshotDict]),
  		false
  	end.
  	
  %% @doc Remove from OpsDict all operations that have committed before Threshold. 	
  prune_ops(OpsDict, Threshold)->
  	orddict:filter(fun(_Key, Value) -> 
  				%lager:info("This is the operation to analyse: ~n ~p", [Value]),
  				(belongs_to_snapshot(Threshold,(lists:last(Value))#clocksi_payload.snapshot_time)) end, OpsDict).
  
  
  