remove LeaderBarrier.

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