The problem is, when/if I remove that code, the program won't execute.
Wrong. The program will execute, but if don't you run it from a console, it'll run so quickly and disappear you won't even see it. That line is to prevent it from disappearing by prompting for user input just before it terminates.
I'd recommend doing this instead though: