tree structure fixed, still needs whitespace after each word