fixes in weighted dist