correctly finds all paths J to W with dfs