Removed confusing unused weighted_average parameter