Implement breadth-first search for speed, quality