bugs

many bugs solved in both BFS and DFS