Adding support for swapping.