add permutation sequence
a more simplified code