permutations as functions