function to integrate particle numbers added, not tested yet