now handles multiple trees in the input file. one per line