Thanks for sending this. I think this is correct and logically the same as Dmitry's version, but I decided to prefer the original because it matches the calculation we use elsewhere.