KmeansCluster code Optimized