modified findsourcetrees.R