Added SWAP function