changed to switch case