quick update of cal_avg.py