adding generic BFS and DFS with callbacks