added adjacent_swap method