first go at a swap() function.
moved to package
put swap() in package and document.