debugging breadth first search