Two separate tests before creating the loop for the answer