added an else if to the conditional