Breadth-first search working.