Cycle refactor seems to work.
Move permutations to separate directory.