Add sorting elements in array example