The variable naming is confusing: `weights` is a scalar, but `weight` is a vector.