using a conditional statement to print to the console