add test and some changes
added DFS
add DFS