removeCircularEdges at the end