added purity computation of clusters