Deductions & credits

there are various methods for computing average balance see IRS PUB 936 page 13

https://www.irs.gov/pub/irs-pdf/p936.pdf