Balance algorithm for cluster randomized trials