adding dfs impl