initial and final permutations done