Adding loop to continually ask for input, fixing structure of functions