Added BFS for pellet search.