Addded create SWAP function