added switch statement