finished breadth first search and test