OPINION OF THE COURT
Krausman, J.Forty years ago, the Legislature enacted Social Services Law § 143-b, which authorizes “public welfare official [s]” to withhold rent payments to landlords on behalf of welfare recipients if the building in which a recipient lives has outstanding code violations (Social Services Law § 143-b [2]). Pursuant to the statute, it is “a valid defense in any action or summary proceeding against a welfare recipient for non-payment of rent to show existing violations” related to dangerous or hazardous conditions in the building where the recipient resides (Social Services Law § 143-b [5] [a]). According to the sponsor of the legislation, the late Samuel A. Spiegel, section 143-b was intended to compel “slumlords” to repair their properties, and to prevent taxpayer money from being used to subsidize substandard housing (see Statement by Assemblyman Samuel A. Spiegel, Mar. 31, 1962, Bill Jacket, L 1962, ch 997). On appeal, we are asked to resolve the issue of whether a welfare recipient may raise Social Services Law § 143-b, commonly called the “Spiegel Law,” as a defense in a nonpayment proceeding where, as here, the New York City Human Resources Administration (hereinafter the HRA) pays a portion of the recipient’s rent directly to the landlord, but has taken no steps to withhold its share of the rent. For the reasons which follow, we find that the statute permits the Spiegel Law to be raised as a defense only where the HRA or other appropriate social ser*166vices agency has exercised its right to withhold direct rent payments to landlords based upon the existence of code violations in the recipient’s building.
I
The appellants, Alexandra Rosario and Leonijildo Rosario (hereinafter the tenants), reside with their children in an apartment building owned by the respondent, Notre Dame Leasing, LLC (hereinafter the landlord). It is undisputed that the tenants receive public assistance, and that the HRA pays a portion of their rent directly to the landlord. However, since their shelter allowance does not fully cover the cost of their apartment, the tenants are responsible for payment of the balance of the monthly rent.
On or about January 4, 2000, the landlord commenced a summary proceeding in the Civil Court, Queens County, to evict the tenants for nonpayment of rent. The landlord claimed that the tenants failed to fully pay their rent in October, November, and December 1999, and that the entire January 2000 rent was outstanding. As a defense to the proceeding, the tenants relied upon the portion of the Spiegel Law which provides that it shall be “a valid defense” in any nonpayment proceeding against a welfare recipient “to show existing violations in the building wherein such welfare recipient resides which relate to conditions which are dangerous, hazardous or detrimental to life or health as the basis for non-payment” (Social Services Law § 143-b [5] [a]). In February 2000, the tenants moved for summary judgment dismissing the proceeding based upon their Spiegel Law defense. In support of the motion, the tenants submitted records from the New York City Department of Housing Preservation and Development (hereinafter the HPD), which indicated that there were a total of 33 class B and C violations outstanding against the building in which they resided. The HPD deems a class B violation to be “hazardous” and a class C violation to be “immediately hazardous” pursuant to Administrative Code of City of NY § 27-2115 (d).
In opposition to the motion, the landlord submitted an affidavit from the director of its management company. The director averred that she had recently requested the HPD to reinspect all outstanding violations for the building. According to the director, two reinspections were conducted in early February 2000, resulting in dismissal of 13 of the 33 violations. Nineteen other violations allegedly were marked “pending” *167because the inspector was unable to gain access to the subject apartments. The director further claimed that the 19 pending violations had been corrected, and that she had requested the agency to dismiss them. The director also stated that work had begun to correct the final remaining violation.
By order entered April 19, 2000, the Civil Court, Queens County, found that the tenants had made a prima facie showing that the Spiegel Law defense applied, but concluded that they were not entitled to summary judgment dismissing the proceeding because there was an issue of fact as to whether repairs had been made in the apartments which were the subject of the 19 violations marked “pending” on reinspection. The Civil Court did, however, grant the tenants’ motion to the limited extent of directing that the proceeding be stayed until the landlord submitted satisfactory proof that the pending violations had been corrected.
The landlord appealed, and the Appellate Term for the 2d and 11th Judicial Districts reversed the Civil Court order and denied the tenants’ motion for summary judgment in its entirety. The Appellate Term concluded that the Spiegel Law defense was not available to the tenants because the HRA had not withheld its share of rent payments to their landlord based upon the existence of code violations. In support of its decision, the Appellate Term pointed out that the statute authorized only “public welfare official [s]” to withhold rent. The Appellate Term then reasoned that “because it is only the public welfare official, and not the individual tenant, who is vested with the authority to determine if the existence of violations in the building justifies the withholding of the rent payments * * * it is only after the official has made such a determination and actually withheld rent payments that it can be said that the ‘existing violations’ are the ‘basis for non-payment’ ” (quoting Social Services Law § 143-b [5] [a]) within the meaning of the statute. The Appellate Term subsequently granted the tenants leave to appeal to this Court.
II. The Spiegel Law
Social Services Law § 143-b, which was enacted in 1962, is entitled “Avoidance of abuses in connection with rent checks.” The statute begins in subdivision (1) by authorizing the “public welfare department” to make rent payments for eligible public assistance recipients directly to their landlords. Subdivision (2), which is the heart of the legislation, then gives “[e]very public welfare official” the power to “withhold the payment of *168any such rent in any case where he has knowledge that there exists or there is outstanding any violation of law in respect to the building containing the housing accommodations occupied by the person entitled to such assistance which is dangerous, hazardous or detrimental to life or health.” In subdivision (3) of the statute, “public welfare official [s]” are further given the authority to initiate, or request the welfare recipient to initiate, a proceeding for the reduction of rent where the official has knowledge that the landlord is not providing essential services. Subdivision (4) gives the public welfare department the further right to obtain and maintain records of building violations.
After setting forth the rights granted to public welfare officials and the public welfare department in subdivisions (1) through (4), the statute addresses the circumstances under which the existence of code violations may be used as a defense to eviction in subdivision (5). According to Social Services Law § 143-b (5) (a), “[i]t shall be a valid defense in any action or summary proceeding against a Welfare recipient for nonpayment of rent to show existing violations in the building wherein such welfare recipient resides which relate to conditions which are dangerous, hazardous or detrimental to life or health as the basis for non-payment.” Furthermore, pursuant to section 143-b (5) (b), a landlord who commences a nonpayment proceeding shall not be entitled to a judgment of eviction or a money judgment “on the basis of non-payment of rent for any period during which there was outstanding any violation of law relating to dangerous or hazardous conditions or conditions detrimental to life or health.”
At the time Social Services Law § 143-b was enacted in 1962, the New York State Department of Welfare (hereinafter the Welfare Department) made annual payments of $68,000,000 to provide shelter for welfare recipients (see Statement by Assemblyman Samuel A. Spiegel, Mar. 31, 1962, Bill Jacket, L 1962, ch 997). According to the late Assemblyman Spiegel, in many instances these payments were made “to landlords who maintain hazardous or dangerous violations on property; who do not give the complete services to tenants who are Welfare recipients; who have been hailed to court and convicted as ‘slumlords’; and who have failed to take any action to prevent deterioration of buildings in which tenants who are Welfare recipients live” (id.). The primary aim of the statute was to immediately stop the practice of “subsidizing slumlords who abuse and exploit welfare tenants, but nevertheless receive guaran*169teed monthly rent checks” (see Letter to Honorable Robert MacCrate from Assemblyman Samuel A. Spiegel, Apr. 6, 1962, Bill Jacket, L 1962, ch 997). It was also hoped that the legislation would improve housing conditions for welfare recipients by providing the Welfare Department with the “potent and effective weapon” of withholding rent payments “to obtain decent and clean apartments for welfare recipients” (id.).
III. The Constitutional Challenge to the Statute
Five years after the enactment of the statute, the Court of Appeals upheld the constitutionality of the Spiegel Law in the 1967 case of Matter of Farrell v Drew (19 NY2d 486 [1967]). In Farrell, a landlord brought summary eviction proceedings against three welfare recipients who were tenants in the same building. The proceedings were consolidated and the Welfare Department, which had been making the rent payments for these tenants directly to the landlord, appeared on their behalf as amicus curiae, asserting the Spiegel Law as a defense. The only violation on record against the building involved a door in the apartment of a fourth tenant which did not fit properly. Although the landlord had attempted to repair the door, it still did not fully close. On appeal, the landlord contended that the rent abatement provided by section 143-b constituted a denial of equal protection because it was aimed only at the landlords of welfare recipients. The Court of Appeals rejected this argument, observing that “[i]n the situation presented by the cases before us, it is the landlords of welfare recipients who, the Legislature found, ‘conspicuously offend’. To be sure, they are not the only landlords who fail to make repairs in slum dwellings. But welfare recipients have even less freedom than other tenants of deteriorated buildings in selecting a place to live * * * and the landlords of welfare recipients, secure in their receipt of rents directly from public funds, have even less incentive than other landlords to make repairs. Under circumstances such as these, if the Legislature chooses to select one class of landlords and impose a special sanction against them, the equal protection clause does not forbid it.” (Id. at 492.) The Court of Appeals also rejected the landlord’s argument that the Spiegel Law was unconstitutional because it was an abuse of the State’s police power, and impaired her contractual rights. In this regard, the Farrell Court concluded that it was clear that the State may, “in the exercise of its police power, provide for the curtailment of rent payments to landlords as a means of inducing them to eliminate dangerous housing conditions,” *170(id.) and that the statute “may not be stricken as unconstitutional even though the means devised to accomplish the result may, to some extent, impair the obligation of the landlord’s contract.” (Id. at 494.)
IV
Despite the fact that the Court of Appeals upheld the constitutionality of the statute in Farrell, it appears that the Siegel Law defense fell out of use for many years. This Court is advised by amicus curiae that the primary reason for this disuse is that the HRA and other social services agencies have chosen not to exercise the right to withhold direct rent payments to landlords. Amicus curiae has also brought to our attention that there has been a significant change in the manner in which the HRA provides shelter payments to New York City welfare recipients. According to amicus curiae, up until 1975, shelter grants to welfare recipients were individually determined and covered the entire cost of housing. However, shelter grants are now fixed and determined according to criteria such as family size. In New York City, this leaves many recipients with housing costs which are more than the shelter grant paid by the HRA because shelter levels have not increased at the same rate as rising housing costs. Thus, in New York City, it is apparently common for the HRA to pay only a portion of the recipient’s actual shelter cost. Welfare recipients are encouraged to have their shelter grants paid directly to their landlords to prevent them from using shelter funds on other needs, thus reducing the threat of eviction. However, since in many cases the HRA does not pay the recipient’s full rent obligation, the threat of eviction is still present where the recipient fails to pay the remaining balance due.
Interest in the Spiegel Law was revived in 1997, when the Legislature amended subdivision (2) of RPAPL 745, essentially to require that tenants seeking adjournments of eviction proceedings deposit their rent into court. Notably, certain tenants are exempt from the rent deposit requirement. The deposit requirement does not apply where the tenant can establish, “at an immediate hearing, to the satisfaction of the court,” that he or she has properly interposed certain specified defenses, including a defense pursuant to Social Services Law § 143-b, the Spiegel Law. (RPAPL 745 [2] [a].) Following the amendment of the “rent deposit law,” welfare recipients who were respondents in nonpayment proceedings began to raise the Spiegel Law as a defense to their failure to pay their share of *171their rent obligation. Although some landlords argued that recipients could not rely upon the Spiegel Law as a defense unless the appropriate social services agency had first acted to withhold its share of rent payments, at least two reported cases rejected this argument, and concluded that the defense was available to these tenants (see Dearie v Hunter, 177 Misc 2d 525 [1998], mod on other grounds 183 Misc 2d 336 [2000]; Crystal Apts. Group v Hubbard, 178 Misc 2d 333 [1998]). In concluding that public assistance recipients could raise the Spiegel defense even where the appropriate social services agency had not chosen to withhold its share of the recipient’s rent, the Crystal Apts. Group court reasoned that “[n] either the statute nor the relevant cases provide that the defense can only be utilized by [the social services agency]. Nor does it appear that the Spiegel Law defense applies only to claims for the [agency] portion of payment * * * The statute is devoid of language prohibiting recipients from interposing this defense if [the agency] continues to make payment. Had the Legislature intended to apply the Spiegel Law defense only to the [agency] portion of the rent, it would not have used inclusive language such as a valid defense to all welfare recipients for nonpayment proceedings if there are violations in a building and not necessarily in the apartment” (id. at 336).
V
On appeal, the tenants urge this Court to reverse the Appellate Term and find that the plain language of Social Services Law § 143-b (5) permits welfare recipients to raise a Spiegel Law defense regardless of whether the HRA or other social services agency has first acted to withhold direct rent payments to the landlord. However, viewing the language of the statute as a whole and considering its legislative history leads us to agree with the Appellate Term’s conclusion that public assistance recipients may only raise the Spiegel Law defense where the HRA or other appropriate agency has first exercised the authority to withhold direct rent payments to the landlord based upon the existence of violations.
It is a fundamental tenet of statutory construction that a statute or ordinance be construed as a whole and that its various sections be considered together and with reference to each other (see People v Mobil Oil Corp., 48 NY2d 192, 199 [1979]; McKinney’s Cons Laws of NY, Book 1, Statutes §§ 97, 98). In this regard, “[e]very part of a statute must be given meaning and effect * * * and the various parts of a statute must be *172construed so as to harmonize with one another” (Heard v Cuomo, 80 NY2d 684, 689 [1993]). Thus, in interpreting a statute, the preferred method is to “approach the statute’s provisions sequentially and give the statute a sensible and practical over-all construction, which is consistent with and furthers its scheme and purpose and which harmonizes all its interlocking provisions” (Long v Adirondack Park Agency, 76 NY2d 416, 420 [1990]).
Although we recognize that subdivision (5) of the statute does not expressly limit the availability of the Spiegel Law defense to cases in which the HRA or other social services agency has first acted to withhold direct rent payments, this interpretation harmonizes the provisions of the statute, and is consistent with its legislative history. As we have noted, the first four subdivisions of the statute give either public welfare officials or agencies the right to take certain actions. Subdivision (1) authorizes the practice of making direct payments to landlords, while subdivision (2) gives public welfare officials the power to withhold direct rent payments due to the existence of outstanding code violations. In subdivision (3) of the statute, public welfare officials are given the authority to initiate proceedings for the reduction of rent where essential services are not being provided. To aid officials in exercising these rights, subdivision (4) further permits public welfare agencies to obtain and maintain records of building violations. Together, these subdivisions manifest a clear legislative intent to confer the right to withhold rent on social services officials rather than individual welfare recipients. Since only a social service official is permitted under the statute to withhold rent from a landlord who may be providing substandard housing, a “sensible and practical over-all construction” of the statute (Long v Adirondack Park Agency, supra at 420) compels the conclusion that the Spiegel Law defense applies only in cases where the appropriate official has first exercised this right.
Our conclusion is also supported by the language of subdivision (5) itself, which provides that it shall be a valid defense in a nonpayment proceeding to show existing dangerous violations in the welfare recipient’s building “as the basis for nonpayment” (Social Services Law § 143-b [5] [a] [emphasis added]). Inasmuch as social services officials are the only individuals authorized to determine whether the existence of hazardous violations warrants withholding rent, the Appellate Term properly found that the official must first act to withhold payments in order for the existence of violations to be deemed *173“the basis for non-payment.” Moreover, it is only where the appropriate social services official has formally acted to halt payment under the Spiegel Law that the court can be assured that the existence of code violations was genuinely the basis for nonpayment of rent. Unfortunately, it appears that the social services agencies of this state have not exercised the rights they have been granted under the Spiegel Law to withhold rent and thus compel the swift correction of code violations. However, we cannot remedy this failure by reading into the statute an implied right for individual public assistance recipients to withhold rent, and justify nonpayment by asserting the existence of code violations.
Furthermore, a contrary holding essentially giving individual welfare recipients the right to withhold payment of rent for building violations which do not directly affect the habitability of the recipient’s apartment would unconstitutionally impair the landlord’s contractual right to receive payment. It is well settled that a State’s police power, which is “the sovereign right of the government to protect the * * * general welfare of the people,” is paramount to any rights under contracts between individuals (East N.Y. Sav. Bank v Hahn, 326 US 230, 232 [1945]). Thus, “the State’s interest in protecting the general good of the public through social welfare legislation is paramount to the interests of parties under private contracts, and the State may impair such contracts * * * so long as it is reasonably necessary to further an important public purpose and the measures taken that impair the contract are reasonable and appropriate to effectuate that purpose” (Crane Neck Assn, v New York City /Long Is. County Servs. Group, 61 NY2d 154, 167 [1984], cert denied 469 US 804 [1984]). As we noted previously, in Matter of Farrell v Drew (supra), the Court of Appeals recognized that the Spiegel Law impaired the contractual rights of landlords to some extent, but found that the statute was a proper exercise of the police power because it authorized the State to withhold rent payments to landlords as a means of inducing them to eliminate dangerous housing conditions. While the Farrell Court recognized that state welfare officials may exercise the power to withhold rent for the general good of the public, it did not contemplate the delegation of this authority to the individual welfare recipient. Moreover, extending the right to decide whether a landlord is undeserving of rent to the individual recipient is not necessary to the achievement of the public purpose underlying enactment of the statute. Rather, these underlying policy goals can best *174be effectuated by encouraging wider use of the statute by the state officials entrusted by the Legislature with the right to withhold rent to landlords of substandard buildings. For these reasons, we find that it would be an impermissible impairment of contract to permit individual recipients, rather than state officials, to withhold rent payments under the Spiegel Law. Accordingly, we affirm the order, without costs or disbursements.