working on BFS & AStar