weighted sum fixes