Trying to build the tree from filenames array.