Changed to use try() {} to assure Scanner object gets closed