adds nested if else statements