changed if statements to else if