Kmeans cleanup

can you do a typecheck here with a REQUIRE?