finished dfs
added some comments