Updating Particle class for exercise 3.3.