Added averager code