adding avgBy