Wrote infrastructure for the stats