Improve average calculation

WeightedAverage added
Why was this like this... lets see what happens