first iteration of word-count javascript