word count - added logic to split words and ignore blank lines