Task 1

I validated the function so that multiple things can be inputted without
the program crashing.