Iterating permutations