anchor.diff:  		case orddict:filter(fun(Key, _Value) -> 
   				belongs_to_snapshot(Key, SnapshotTime) end, [H|T]) of 
   			[]->
  -		        {ok,[]};
  +		        {ok,no_snapshot};
   		    [H1|T1]->
   				{CommitTime, Snapshot} = lists:last([H1|T1]),
   				{ok, {CommitTime, Snapshot}}
  
positive.code:         	%lager:info("operation being stored: ~p", [DownstreamOp]),
          	OpsDict1=orddict:append(DownstreamOp#clocksi_payload.commit_time, DownstreamOp, OpsDict),
          	%lager:info("materialiser_vnode: OpsDict= ~p",[OpsDict1]),
              true = ets:insert(OpsCache, {Key, ops_gc(OpsDict1)}),
              {reply, ok, State};
          {error, Reason} ->
              {reply, {error, Reason}, State}
  
negative.code:             	SnapshotDict=orddict:new(),
              	ets:insert(SnapshotCache, {Key, orddict:store(CommitTime,Snapshot, SnapshotDict)})
              end;
          [{_, SnapshotDict}] -> 
              case get_latest_snapshot(SnapshotDict, SnapshotTime) of
  			{ok, {_SnapshotCommitTime, LatestSnapshot}}->
  				%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;
  			{ok, no_snapshot} ->
  				%%FIX THIS, READ FROM THE LOG WHEN THERE IS NO SNAPSHOT.
  				Snapshot=no_snapshot,
  				{reply, {ok, Snapshot}, State}
  			end	
      end,
  	%lager:info("materialiser_vnode: snapshot: ~p", [Snapshot]),
  	{reply, {ok, Snapshot}, State};
  