Serial BFS Implementation