Vectorized the clustering calculations.