Made the calculation work