small update to swap_with_next method