Adding functions related to weights.