Added k-means implementation