Why the nested if ?