use copy and standard library sort to sort the strings