Bug seems to be rooted in the BFS of process()