added test for alphabetical word sorting and changed name of sort function to reflect versatility