ParticleCounter: reduce recursion in lut relabelling