changed switch statement