add python version, but wrong solution for dfs