Fixed Breadth first by marking nodes as visited.