docstring for treesearch