rewrote stats.py to be multiprocess