Updated parsing method and added words array to treenode structure