in the process of debugging k-means not quite done though