Journal entry concept of goodwill related to the acquisition of another company, accounting homework help

Please discussion the concept of goodwill related to the acquisition of another company. Describe how it is calculated and what impacts the amount carried (include in your discussion the idea of impairment).

Please provide a response to the following problem:

ABC company purchased XYZ Company for $3,700,000 in cash. The market value of XYZ  company’s assets and liabilities on the acquisition date were $4,000,000 and $1,500,000 respectively.

Compute the cost of the goodwill purchased by ABC company and journalize the entry to record the acquisition. How will the company account for this goodwill in future accountng periods?