kappa,
We completely have different interpretations of why the OP chose to read from STDIN during the main execution of the program. I was assuming it was to get the program to pause long enough to test and it was the extra carriage return(s) that were not desired.