modified permutation