moved sumBy to here