slight modification to autoclustering