simplified name and added switch statements