updated switch statement