tree method