anchor.diff:  %%      NewSS: Boolean that is true if any operations should be applied, fale otherwise.  Should start as false.
   %%      Output: A tuple with 4 elements or an error.  The first element of the tuple is the atom ok.
   %%      The second element is the list of operations that should be applied to the snapshot.
  -%%      The thrid element is the snapshot time of the last operation in the list.
  -%%      The fourth element is a boolean, true if a new snapshot should be generated, false otherwise.
  +%%      The third element 1 minus the number of the operation with the smallest id not included in the snapshot.
  +%%      The fourth element is the snapshot time of the last operation in the list.
  +%%      The fifth element is a boolean, true if a new snapshot should be generated, false otherwise.
   -spec materialize_intern(type(), 
   			 [clocksi_payload()],
   			 integer(),
   			 integer(),
   			 snapshot_time() | ignore,
   			 snapshot_time(),
  -			 [clocksi_payload()], 
  +			 [{integer(),clocksi_payload()}],
   			 txid() | ignore, 
   			 snapshot_time() | ignore,
   			 boolean()) ->
  
positive.code: %%      Ops: The list of operations to apply in causal order
  %%      TxId: The Id of the transaction requesting the snapshot
  %%      Output: A tuple. The first element is ok, the seond is the CRDT after appliying the operations,
  %%      the third element is the smallest vectorclock that describes this snapshot,
  %%      the fourth element is a boolean, it it is true it means that the returned snapshot contains
  %%      more operations than the one given as input, false otherwise.
  -spec materialize(type(), snapshot(),
  		  integer(),
  		  snapshot_time() | ignore,
  		  snapshot_time(),
  		  [clocksi_payload()], txid() | ignore) -> {ok, snapshot(), integer(),
  							    snapshot_time() | ignore, boolean()} | {error, reason()}.
  materialize(Type, Snapshot, LastOp, SnapshotCommitTime, MinSnapshotTime, Ops, TxId) ->
      FirstId = case Ops of
  		  [] ->
  
negative.code: 		     %% Check if the op is not in the previous snapshot and should be included in the new one
  		     case (is_op_in_snapshot(TxId, Op, OpCom, OpSS, MinSnapshotTime, SnapshotCommitTime, LastOpCt)) of
  			 {true,_,NewOpCt} ->
  			     %% Include the new op because it has a timestamp bigger than the snapshot being generated
  			     {ok, [Op | OpList], NewOpCt, false, true, FirstHole};			     
  			 {false,false,_} ->
  			     %% Dont include the op
  