Deductions & credits

I had to pay the 7 k at closing

Keep in mind that any mortgage payoff does not factor into the calculation of gain or loss.