particle class has mass.
centroid calculation added.