the real kmeans clustering. all in one. almost from scratch