renamed swap_with_next variables