working on magic ring permutations