working on permutations