Fixed set difference issue but bugs still persist with BFS.