changed if statement to switch
changed if statement to switch