Reverted change in swap function.