BFS algorithm included