change if to switch-case