Appears to be working with tree stucture. Saves output in root file.