format output, refactor create_word_arrays