Implement BFS controller