Changed bfs

changed snippet bfs