new function added to reweight ptww