fix weights, group by