Refactored rectangle violation into checkRectanglesCorrect