change if statement to switch