Particle analysis

Updated the particle analysis code.