Implemented rectangle splitting and storage