initial answer to word-count in scala