aha was applying permutation backwards