anchor.diff:  	end,
       {next_state, prepareOp, SD1, 0}.
       
  -    
  +%%	when the tx updates multiple partitions, a two phase commit protocol is started.
  +%%	the prepare_2PC state sends a prepare message to all updated partitions and goes
  +%%	to the "receive_prepared"state. 
   prepare_2PC(timeout, SD0=#state{transaction=Transaction, updated_partitions=UpdatedPartitions}) ->
   	TransactionLight=Transaction#tx{write_set=[]},
   	clock_SI_vnode:prepare(TransactionLight, UpdatedPartitions),
   	NumToAck=lists:lenght(UpdatedPartitions),
   	{next_state, receive_prepared, SD0#state{transaction=TransactionLight, num_to_ack=NumToAck}, ?CLOCKSI_TIMEOUT}.
   	
  -	
  -
  -receive_prepared({_Node, ReceivedPrepareTime}, S0=#state{num_to_ack= NumToAck, transaction=Transaction}) ->
  -	
  -	
  +%%	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({_Node, ReceivedPrepareTime}, S0=#state{num_to_ack= NumToAck, transaction=Transaction}) ->		
   	PrepareTime = max(Transaction#tx.prepare_time, ReceivedPrepareTime),
  -
       case NumToAck of 1 -> 
       	io:format("ClockSI: Finished collecting prepare replies, start committing..."),
   		{next_state, committing, S0=#state{transaction=#tx{prepare_time=coomit_time=PrepareTime, state=committing}},0};
  
positive.code: 		1 ->
  			[IndexNode]=UpdatedPartitions,
  			clockSI_vnode:local_commit(IndexNode, Transaction);
  		_ ->
  			{next_state, prepare_2PC, SD0, 0}		
  		end;
  
negative.code: %%@doc	The coordinator for a given Clock SI transaction.  
  %%		It handles the state of the tx and executes the operations sequentially by
  %%		sending each operation
  %%		to the responsible clockSI_vnode of the involved key.
  %%		when a tx is finalized (committed or aborted, the fsm
  %%		also finishes.
  
  -module(clockSI_tx_coord_fsm).
  -behavior(gen_fsm).
  -include("floppy.hrl").
  