This changes the logic and your commit says it's just 'indentation' but you have changed the logic without explanation. It should be `else if` imo