implement bfs, dfs from skienna