refactored dg to dependency_graph