Add term statistics function