accepting rectangles with unsorted coordinates