changed to switch statement