A. Compute Bob's realized gain (loss) on the exchange.
$320,000 + $40,000 + $80,000 = $440,000 - that is selling price
$440,000 - $240,000(basis) = $200,000 - that is realized gain
B. Compute Bob's taxable recognized gain.
$200,000 / $440,000 = 45.45%
($40,000 + $80,000) * 45.45% = $54,544
C. Compute Bob's basis in the land.
$(440,000-120,000) / $440,000 = 72.72%
$240,000 * 72.72% = $174.545