Added an if statement to print a result to console when the condition is not true.