Added word sorting algorithm, with rudimentary keyphrase detection