Swap Function Implementation Using Decoder