Improved Word Sorting Program