particle system code structure