Added SWAP creation function