Construction of the weights