add and refactor DirectedCycle classes