changes the code to sort an array in numeric arder