fix permutations construction