when for switch statement