Putting together the variables with if and else statements