Added swap_values function