Accumulation function

Diversity accumulation.