I need to write my own sort() function for an assignment. Let's start off with this list to sort:
data_list = [-5, -23, 0, 100, 23, -6, 23, 67]
I create a new list, which will be sorted, empty for now:
new_list = []
And here is some code that I found on stackoverflow, thank you community :)
def sortData(lista):
    while lista:
        minimum = lista[0]  # arbitrary number in list 
        for x in lista: 
            if x < minimum:
                minimum = x
        new_list.append(minimum)
        lista.remove(minimum) 
    return new_list
sortData(data_list)        
print(new_list)
The result is
new_list = [-23, -6, -5, 0, 23, 23, 67, 100]
So far so good. But what I need is to sort a 2D list, and I need to sort it by the last column, in decreasing order. Here is the 2D list
lista = [['countries', 2019, 2021, 2022],['aruba', 2,13,8],
         ['barbados', 6,34,-39],['japan', 12,8,16]]
As you can tell, I must NOT include the first row in the sort, obviously. So the sort needs to be starting at the second row, and the data needs to be sorted by the last column in decreasing order. The desired result would be:
listaSorted = [['countries', 2019, 2021, 2022],['japan', 12,8,16],['aruba', 2,13,8],['barbados', 6,34,-39]]
If i use the current code, i just get the list sorted by the first column and including the first row, see here:
def sortData(lista):
    while lista:
        minimum = lista[0]  # arbitrary number in list 
        for x in lista: 
            if x < minimum:
                minimum = x
        new_list.append(minimum)
        lista.remove(minimum) 
    return new_list
listToSort = [['countries', 2019, 2021, 2022],['japan', 12,8,16],['aruba', 2,13,8],['barbados', 6,34,-39]]
new_list = []
sortData(listToSort)        
print(new_list)
new_list = [['aruba', 2, 13, 8], ['barbados', 6, 34, -39], ['countries', 2019, 2021, 2022], ['japan', 12, 8, 16]]
So that does not work :(
I cannot use any imported modules. And I have been advised not to remove elements from the first list. I agree. That might mess up the earlier parts of my program. I am pretty stuck, any help would be awesome!

enumerateandzip?.reversedmethod to sort from last colomn