K Means script update