Major update of the enrichment function