implement driver for counting words