adding getDistinctRectangles in Rectangle class