add breadth first search algorithm