rectangles and search in binary tree