Changed to class, private swap and insertion_sort functions.