basic BreadthFirstSearch implemented