working for avgD