Made the swap functions swap values instead of pointers.