simplify if
Merge pull request #281 from kjbekkelund/simplify-if

simplify if