added detect cycle (indegrees) on graph