A naive, slow but sort-of working implementation of K-means clustering