Form 4797, Part 1, 2f

Can someone please explain how the number in Form 4797, Part1, 2f is calculated (i.e., what's included), why it's so high and why it differs from Part 2, Line 24?  It results in a huge deduction from my capital gain on this property sale and I'm not sure why.  Here are screenshots from my form.

 

Part 1 2f.pngLine 24.png