added averaging to b0avg.py