Add some additional functions for stats to stats.py script.