Aufgabe2: sorting by value also sorts by key when equal
Aufgabe2: performance improvement