... and I have an exit instead of an end in one place where it should actually end, so that the whole run of the program terminates. Try adding a "print" ahead of that "exit" (and every where else it should print).