fold method tree