Added function to sort the list of rectangles.