finish weighted sum calculation