Sorting: re-arranging elements in an array into ascending order