added kcluster function.