Removing a repetition of printing all the sorted numbers.