If any provision of this Agreement is declared or found to be illegal, unenforceable, or void, in whole or in part, then both parties shall be relieved of all obligations arising under such provision, but only to the extent such provision is illegal, unenforceable, or void, it being the intent and agreement of the parties that this Agreement shall be deemed amended by modifying such provision to the extent necessary to make it legal and enforceable while preserving its intent or, if such is not possible, by substituting therefor another provision that is legal and enforceable and achieves the same objectives. The foregoing notwithstanding, if the remainder of this Agreement shall not be affected by such declaration or finding and is capable of substantial performance, then each provision not so affected shall be enforced to the extent permitted by law.