automatically choosing the number of K