use if instead of match