Particle function now encapsulated in class