if not PriceTracker then return end local MathUtils = {} PriceTracker.mathUtils = MathUtils function MathUtils:WeightedAverage(itemTable) for item in itemTable do sum = sum + item.purchasePrice weight = weight + item.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