2-clustering. add maxSpacing