recursive_dfs() now looks better