Process scheduling DAG before calculating roots, added some TODOs