if not PriceTracker then return end local MathUtils = {} PriceTracker.mathUtils = MathUtils function MathUtils:WeightedAverage(itemTable) local sum = 0 local weight = 0 for i = 1, #itemTable do sum = sum + itemTable[i].purchasePrice weight = weight + itemTable[i].stackCount end return math.floor(sum / weight) end function MathUtils:Max(itemTable) local price = 0 for item in itemTable do if item.price > price then price = item.price end end return price end