first working version of permutations