For the stepwise BFS algorithm, improved the functionality to swap between steps statically.