Updated InsertionSort using inout keyword