fixed bugs for lognormal weights