rsum is now weight*r