Selling of partially amortized goodwill.

Original basis: 500,000 Accumulated amortization: 400,000 Selling price(as stated on escrow statement): 1,500,000 how should these info. be reported on an S corp tax return? should the gain be on 4797 or schedule D? is there a recapture of the 400,000? how to get rid of the remaining 100,000 adjusted basis of the goodwill on 4562? Thanks in advance.