richness function added