Refactor ctr_sum into ctr_refs for reuse
Add AVG - not working yet