if and if else, but has the dangling else problem