anchor.diff:              false
       end.
   
  -%% @doc Garbage collection.
  +%% @doc Garbage collection triggered by reads.
   snapshot_insert_gc(Key, SnapshotDict, OpsDict, SnapshotCache, OpsCache)-> 
   	case (orddict:size(SnapshotDict))==?SNAPSHOT_THRESHOLD of 
   	true ->
  
positive.code:             	SnapshotDict=orddict:new(),
              	ets:insert(SnapshotCache, {Key, orddict:store(CommitTime,Snapshot, SnapshotDict)})
              end;
          [{_, SnapshotDict}] ->
  			{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]),
              	{ok, Ops}= filter_ops(OpsDict),
              	%lager:info("materialiser_vnode: Ops to apply are: ~p",[Ops]),
              	case Ops of
              	[]->
              	    Snapshot=LatestSnapshot;
              	[H|T]->
              		LastOp=lists:nth(1, Ops),
              		TxId = LastOp#clocksi_payload.txid,
  					{ok, Snapshot} = clocksi_materializer:update_snapshot(Type, LatestSnapshot, SnapshotTime, [H|T], TxId),
  					CommitTime = LastOp#clocksi_payload.commit_time,
  					%lager:info("previous snapshots are = ~p, ",[SnapshotDict]),
  					%lager:info("materialiser_vnode: caching new snapshot= ~p, snapshot committed with time:~p.", [Snapshot,CommitTime]),
  					%lager:info("previous snapshots are = ~p, ",[orddict:store(CommitTime,Snapshot, SnapshotDict)]),
  					SnapshotDict1=orddict:store(CommitTime,Snapshot, SnapshotDict),
              		snapshot_insert_gc(Key,SnapshotDict1, OpsDict, SnapshotCache, OpsCache)
  					%lager:info("new snapshots are = ~p, ",[ets:lookup(SnapshotCache, Key)])
  				end
              end
      end,
  	%lager:info("materialiser_vnode: snapshot: ~p", [Snapshot]),
  	{reply, {ok, Snapshot}, State};
  
negative.code: 		case orddict:filter(fun(Key, _Value) -> 
  				belongs_to_snapshot(Key, SnapshotTime) end, [H|T]) of 
  			[]->
  		        {ok,no_snapshot};
  		    [H1|T1]->
  				{CommitTime, Snapshot} = lists:last([H1|T1]),
  				{ok, {CommitTime, Snapshot}}
  