Updated Swapping

Updated all swapping to use the swap function provided in the algorithm
library.