Implemented rectangle violation check
Incorporated bug fixes i and j and camelcase