Added method to generate k subsets