nit: Personally I prefer to be defensive and use `<` rather than `!=`.