refactored swap_small to use the multiple assignment syntax