added a test for swap