removed swap function from the common to the sorting file