Hi bwarp,
I believe the problem is here:

"ppm = (AD/64320)*5000"

If AD = 11260 then

(11260/64320) = 0.175

0.175 is not an 'integer' and the result of PBP's math will be '0' - PBP deals with whole numbers, not the fractions.

Arch