adding angle average util function