More bugs in dist, added kmeans