sorting elements in array in asending order