working on rects merger