change Rect to template Rect_T