Added some functionality for swapping keys