During 2020, Sam and Libby, a married couple, decided to sell their residence, which had a basis of $200,000. They had owned and occupied the residence for 20 years. To make it more attractive to prospective buyers, they had the inside painted in April at a cost of $5,000 and paid for the work immediately. They sold the house in May for $800,000. Broker's commissions and other selling expenses amounted to $50,000. The couple purchased a new residence in July for $400,000. What is the recognized gain and the adjusted basis of the new residence