replication algorithm till "updateDataToPhase"