Increment array when comparing, from Harald Barth