add lookup function to tree