added sorting on word counter