Stepped-up basis is important here and mentioned above.

https://en.wikipedia.org/wiki/Stepped-up_basis