generate permutations and combinations