anchor.diff:  %% 	  state: state of the transaction: {active|prepared|committing|committed}
   %%----------------------------------------------------------------------
   -record(state, {
  -          from :: pid(),
  -          txid :: #tx_id{},
  -          operations :: list,
  -          updated_partitions :: list, 
  -          currentOp = undefined :: term() | undefined,
  -          num_to_ack :: int, 
  -          currentOpLeader :: riak_core_apl:preflist2(),
  -          prepare_time :: int,	
  -          commit_time ::int,
  -          read_set :: list,
  -          state}).
  +                from :: pid(),
  +                txid :: #tx_id{},
  +                operations :: list,
  +                updated_partitions :: list, 
  +                currentOp = undefined :: term() | undefined,
  +                num_to_ack :: int, 
  +                currentOpLeader :: riak_core_apl:preflist2(),
  +				prepare_time :: int,	
  +				commit_time ::int,
  +				read_set :: list,
  +				state}).
   
   %%%===================================================================
   %%% API
  
positive.code: %%		starting this transaction has seen, and
  %%	2. 	machine's local time, as returned by erlang:now(). 	
  get_snapshot_time(ClientClock) ->
      {Megasecs, Secs, Microsecs}=erlang:now(), 
      case (ClientClock > {Megasecs, Secs, Microsecs - ?DELTA}) of 
          true->
              %% should we wait until the clock of this machine catches up with this value?
              {ClientMegasecs, ClientSecs, ClientMicrosecs}=ClientClock,
              SnapshotTime = {ClientMegasecs, ClientSecs, ClientMicrosecs + ?MIN};
  
          false ->
              SnapshotTime = {Megasecs, Secs, Microsecs - ?DELTA}
      end,
      {ok, SnapshotTime}.
  
negative.code: %%	the prepare_2PC state sends a prepare message to all updated partitions and goes
  %%	to the "receive_prepared"state. 
  prepare_2PC(timeout, SD0=#state{txid=TransactionId, updated_partitions=UpdatedPartitions}) ->
  	case length(UpdatedPartitions) of
  	0->
  		SnapshotTime=TransactionId#tx_id.snapshot_time,
  	    {next_state, committing, SD0#state{state=prepared, commit_time=SnapshotTime}, 0};
  	_->
  		clockSI_vnode:prepare(UpdatedPartitions, TransactionId),
  		NumToAck=length(UpdatedPartitions),
  		{next_state, receive_prepared, SD0#state{txid=TransactionId, num_to_ack=NumToAck, state=prepared}}
  	end.	
  	
  %%	in this state, the fsm waits for prepare_time from each updated partitions in order
  %%	to compute the final tx timestamp (the maximum of the received prepare_time).  
  receive_prepared({prepared, ReceivedPrepareTime}, S0=#state{num_to_ack= NumToAck, prepare_time=PrepareTime}) ->		
  	MaxPrepareTime = max(PrepareTime, ReceivedPrepareTime),
      case NumToAck of 1 -> 
      	lager:info("ClockSI: Finished collecting prepare replies, start committing... Commit time: ~w~n",[MaxPrepareTime]),
  	{next_state, committing, S0#state{prepare_time=MaxPrepareTime, commit_time=MaxPrepareTime, state=committing},0};
      _ ->
          lager:info("ClockSI: Keep collecting prepare replies~n"),
  	{next_state, receive_prepared, S0#state{num_to_ack= NumToAck-1, prepare_time=MaxPrepareTime}}
      end;
  
  receive_prepared(abort, S0) ->
  	{next_state, abort, S0, 0};   
  
  receive_prepared(timeout, S0) ->
  	{next_state, abort, S0 ,0}.
  
  %%	after receiving all prepare_times, send the commit message to all updated partitions,
  %% 	and go to the "receive_committed" state.
  committing(timeout, SD0=#state{txid=TransactionId, updated_partitions=UpdatedPartitions, commit_time=CommitTime}) -> 
  	NumToAck=length(UpdatedPartitions),
  	case NumToAck of
  		0 ->
      		lager:info("ClockSI-Coord: No updated partitions. Committing and replying to client."),
  			{next_state, reply_to_client, SD0#state{state=committed}, 0};
  		_ ->
  			clockSI_vnode:commit(UpdatedPartitions, TransactionId, CommitTime),
  			{next_state, receive_committed, SD0#state{num_to_ack=NumToAck}}
  	end.
  	
  %%	the fsm waits for acks indicating that each partition has successfully committed the tx
  %%	and finishes operation.
  %% 	Should we retry sending the committed message if we don't receive a reply from
  