changed dag::is_dag and dag::schedule to using only one stack