Added BFS traversal function