dfs uses a stack