Added implementation of validIntersections
Added implementation to check for valid rectangles