Added an else if statement.