Deductions & credits

[Edited]

I'm going to remove this answer and re-write it.