change choosing all subsets to subsets with length k