Implement word count and word top functions