get input at first for repetition
add test for repetition