Documented the code, especially around SampledStat