instead of `in_array`, use two comparisons. More efficient in this case.