internal.weights function

Internal function for defining weights