make WeightFunction a wrapper