The collapsing tunnels code