DO NOT MERGE: Work in progress, refactoring how statistics are calculated