add code used to verify correctness of segmented bfs