add dfs method