added k-means algorithm