@spencer1997 Better bet is to transfer back to X then ensure spouse inherits it.
No CGT on transfer back to spouse.
No IHT on death - transfer to spouse.
Limited CGT on sale as value on death is acquisition cost.
All goes pear-shaped if spouse dies first (it can happen!)