Breadth-first search not working for now