What is the original cost of our home? My inlaws purchased it in 1986 for $65,000 in their name but my husband made payments. In 1998 they quitclaimed deed to us for $1.

In 2002, we refinanced the loan for $120k with $50k cashout to remodel in 2002 and 2003. The home appraised for $170k in 2002 for the lender. We also took out another loan for $20k in 2007 for additional improvements. In 2016 we sold the home for $289K. Also, how do we handle the improvements of $50K? Do we add these to the basis or not since it is included in the refi loan amount? Please help!