Done with BFS but still having some errors