deleted duplicate estimateDistribution function