if converted to switch