added while loop test for user prompt

added while loop test for user prompt