Refine permutation()