export swap (slow but flexible) and swap_ (faster, less flexible)