implement Swap() and test