Second attempt of the clustering algo