Finished dfs, still need to fix # of generated nodes