updated
algorithm sorting selection by min using aref