modification of 'swap'