change if with switch