permutation script complete