got DAG sorting algorithm fixed