added getPermutations