added internal data to KMeans clustering algorithms