Added the option to do weighted or unweighted centroids during
clustering.