No. The gain or loss is the difference between the original cost on the original purchase agreement, plus legal fees, real estate fees and adjustments plus any capital improvements, plus legal fees and real estate fees to sell it and the selling price. The mortgage is not included in the calculation.