updated stats.py for cli data extraction