dfs was slightly wrong all along