added functionality to track the number of swaps for each sort method