Pastable version of Algorithm for zig-zagging over potentially infinite sets