ParticleCounter: working version