Solution to word-count