Changed from if to a switch