Added permutation support