changed big if to switch