BFS search implemented