finished invariants for SelectionSort