another attempt at a dfs tree