Also, double check your math
cost = (uval - 1) / 2
So, at a uval of 0, the cost = -1/2 (but then you apply a minimum)
At a uval of 2, the cost = 1/2 (and the minimum applies)
at 4, the cost = 3/2
At 6, the cost = 5/2
That doesn't match the costs you were describing.
|