Cost Basis and Capital Improvements for sale of Rental

@Carl et al...   Need some guidance.   Bought my condo in 1999 for $92,000.  Bought/moved into another primary residence in August 2009 and put the condo in service as a rental.  Sold the condo (still was a rental) in August 2022 for $342,000.   What should I use as cost basis for the sale?  The original purchase price of $92k?  Or FMV at the time I converted it to a rental in Aug 2009 (need to verify with comps that sold around that time, but FMV was probably around $200-250k at that time)?  Note: I've been using TurboTax which has been depreciating the condo since put into service as a Rental (using $92000 as depreciation cost basis).

 

Also, how do I include closing costs and commissions paid at the time of the 2022 sale along with capital improvements into the cost basis?   It seems that for capital improvements, TurboTax depreciates these over several years, so if I did the improvement (e.g new tile flooring, new hot water heater, new heat pump, etc) more than  few years ago, it is not showing any remaining depreciation and not reducing the capital gains that I owe.


Thanks for your help!!