dfs and dep implementation WIP