put cycles into a separate module
Define DAG
detect dicycles