added sum of weights