I think I fixed the math.  Still need to test.