Added tree search functionality.