swap_ranges implemented, tests written
merge conflicts resolved