added last step of kmeans sample