Your task is to modify the selection sort algorithm so that you find the largest element and swap it to the last position, then continue with the next-largest element and so on.