bfs algorithm to search all combos.