Swap tracking code