switch structure as an alternative to the if structure