testing permutation alg. with python