change if/else to switch