add dfs_loop

as described in video