Adding to K-means functionality.  Still needs tests.