minor changes to avrg.py