Added min and max values to k-means apply