restored if/then/else functionality