breadth search improved
improved addEdge, removed unnecessary code