implement sequential kmeans through Optimizer