first patch to BFS