remove LeaderBarrier.

add balance phase to replication algorithm
Merge branch 'hw3' into boris