Breadth First Search Code In Python