A fail attempt to make switchPath that depends on iteration work.
Remove unused code.