changed if statements to switch