add dfs prototype