if else to switch