Added sorting functions that sort by value (frequency of word) and by alphabetic order (key)