modify permutation sequence