Word counter and sorting - first version