Deductions & credits

It should have been done in 2013, either added to the cost or expended (depending on amount).

And yes, if it was added to the cost it would reduce the gain on the sale now.