
434 N.W.2d 590 (1989)
Richard FELTMAN and Richard Feltman and Paula Feltman, as Guardian for their minor children, G.F. and J.F., Appellants,
v.
Sandra FELTMAN, Appellee, and
The State of South Dakota, Amicus Curiae.
No. 16168.
Supreme Court of South Dakota.
Oral Argument October 13, 1988.
Decided January 11, 1989.
David J. Larson and Ann M. Arnoldy of Larson, Sundall, Larson, Schaub & Fox, P.C., Chamberlain, for appellants.
*591 Charles M. Thompson of May, Adam, Gerdes & Thompson, Pierre, for appellee.
Gary F. Colwill, Sp. Asst. Atty. Gen., Pierre, for amicus curiae.
HEEGE, Circuit Judge.
Richard Feltman and Richard and Paula Feltman as guardians for their children attack SDCL 25-7-7 (child support guidelines) as violating their constitutional equal protection rights. The trial court held that the Feltmans failed to establish that SDCL 25-7-7 was unconstitutionally discriminatory. We affirm.

FACTS
Richard and Sandra Feltman were married in 1969. They were divorced on March 25, 1974. Two children were born of the marriage. As part of a separation agreement, the parties agreed that Sandra Feltman would have custody and Richard Feltman would pay monthly child support of $75.00 per child, for a total of $150.00 per month for both children. The terms of this agreement were accepted by the court and included in the divorce decree.
Both parties remarried, but Sandra Feltman is now divorced from her second husband. In his second marriage, Richard and his wife, Paula, have two children. These two children are minors and reside with Richard and Paula.
Sandra Feltman petitioned the Department of Social Services to conduct a hearing for the purpose of increasing Richard's monthly child support obligation. In applying SDCL 25-7-7, the Department of Social Services, as affirmed by the circuit court, followed this approach: (1) They determined Richard Feltman's net monthly income to be $1,379.71; (2) They determined that there were two children from the previous marriage; and (3) They then determined the proper support amount as $435 per month as specified for two children in the chart in SDCL 25-7-7.
Both the department and the circuit court considered the children of the second family, but concluded that the guidelines chart amount for two children was proper.

CLAIMS RAISED
In this appeal, the Feltmans raise two claims in their argument that SDCL 25-7-7 violates Article VI, Section 18 of the South Dakota Constitution and the Fourteenth Amendment to the United States Constitution. First, they claim that SDCL 25-7-7 violates the equal protection rights of their children because the statute gives child support priority to the children of Richard Feltman's first marriage. As a result, the children of Richard Feltman's second marriage may not receive the same amount of economic support as the children of his first marriage. Their second claim is that SDCL 25-7-7 violates the equal protection rights of children in subsequent relationships because their needs are not taken into consideration when determining the amount of child support for children of a prior relationship. We deal with their claims separately.

I.
We apply the rational basis standard of review to Feltman's claim that SDCL 25-7-7 violates the equal protection rights of children because the statute gives child support priority to the children of the first marriage. No suspect classification nor fundamental right is involved and therefore the strict scrutiny standard is inapplicable. Under the rational basis standard, this court will uphold a statute if the statutory classification bears some rational relationship to a legitimate state purpose. Weber v. Aetna Casualty & Surety Co., 406 U.S. 164, 92 S.Ct. 1400, 31 L.Ed.2d 768 (1972); Dandridge v. Williams, 397 U.S. 471, 90 S.Ct. 1153, 25 L.Ed.2d 491 (1970). The United States Supreme Court has also stated the test inversely when it held in Frontiero v. Richardson, 411 U.S. 677, 93 S.Ct. 1764, 36 L.Ed.2d 583 (1973) that a statute is valid "unless it is `patently arbitrary' and bears no rational relationship to a legitimate governmental interest." 411 U.S. at 684, 93 S.Ct. at 1768, 36 L.Ed.2d at 589 (emphasis added). See also Birchfield v. Birchfield, 417 N.W.2d 891 (S.D.1988).
*592 The burden of proving SDCL 25-7-7 unconstitutional rests with the Feltmans. A statute is presumed constitutional and the party attacking its constitutionality "has the burden of proving beyond a reasonable doubt that the classification violates equal protection rights." Birchfield, supra at 894; In re Marriage of Urban, 293 N.W.2d 198 (Iowa 1980); see also In re Certification of a Question of Law, 372 N.W.2d 113 (S.D.1985); State v. Brown, 296 N.W.2d 501 (S.D.1980); State Theatre Co. v. Smith, 276 N.W.2d 259 (S.D.1979).
The Feltmans have failed to carry their burden of proving that SDCL 25-7-7 bears no rational relationship to a legitimate state interest. The opposite is true. Every parent is required to support their children. SDCL ch. 25-7, 25-7A. To assure that absent and noncustodial parents contribute to the support of all their children, the legislature passed SDCL 25-7-7. Under this statute, a noncustodial parent's monthly child support payment is determined primarily by his or her net monthly income and the number of children from the prior marriage.
The guidelines used in SDCL 25-7-7 for determining a noncustodial parent's monthly child support obligation reflect this court's policy that "the amount of child support depends on the reasonable expenditures suitable to the child's circumstances at the time of divorce and the payor's financial means and ability to pay." Saint-Pierre v. Saint-Pierre, 357 N.W.2d 250 (S.D.1984); Barrett v. Barrett, 308 N.W.2d 884, 885 (1981); Wallahan v. Wallahan, 284 N.W.2d 21 (S.D.1979). This state has an interest in protecting the welfare of its children which includes their standard of living. SDCL 25-7-7 serves to prevent the otherwise often precipitous drop in a child's standard of living when his or her parents divorce and to provide uniform standards for determining the amount of child support each noncustodial parent must pay.
The application of SDCL 25-7-7 may result in the children of a second or third marriage receiving a lesser amount of economic support than the children of the first marriage. This result was clearly considered by the Child Support Commission. In its report to the Governor, the Child Support Commission stated:
The Commission discussed at length the problem of establishing the support obligation for children of second or third families when the noncustodial parent is responsible for previously existing support obligations. It was concluded that the support obligation for the children of each should be established separately and a deduction from the noncustodial parent's gross income for payments on support obligations for children of previous relationships should be allowed in determining the net income for establishing subsequent obligations.
As an example, if a noncustodial parent with a net income of $1,200 had two children by marriage and is divorced, the support obligation in accordance with the guidelines if $342. The parent then remarries and has two children by the second marriage and is divorced. The support obligation for the children of the second marriage would be established between $192 and $216 at the net income level of $858. ($1,200 minus $342) for two children.
SDCL 25-7-7 is constitutional even though the children of a first marriage receive priority in child support. Under the rational basis standard, the court accords great deference to the constitutionality of a statute even if imperfect results are achieved. The United States Supreme Court stated:
In the area of economics and social welfare, a state does not violate the Equal Protection Clause merely because the classifications made by its laws are imperfect. If the classification has some "reasonable basis," it does not offend the Constitution simply because the classification "is not made with mathematical nicety or because in practice it results in some inequality." (citation omitted). "The problems of government are practical ones and may justify, if they do not require, rough accommodations-illogical it may be, and unscientific." (citation omitted). "A statutory discrimination will not be set aside if any state of facts *593 reasonably may be conceived to justify it." (citation omitted).
Dandridge v. Williams, 397 U.S. 471, 90 S.Ct. 1153, 25 L.Ed.2d 491 (1970).
The support format set forth in SDCL 25-7-7 provides a fair and logical prioritization of claims against a noncustodial parent's income. Without prioritization, the children from the first family might find their standard of living substantially decreased by the voluntary acts of a noncustodial parent. A noncustodial parent who becomes responsible for supporting the children of a second marriage does so with the knowledge of a continuing responsibility to the children of the first marriage. We hold that SDCL 25-7-7 has a rational basis and passes muster under the rational basis standard of review.

II.
The second claim raised by the Feltmans is dealt with separately because it misinterprets SDCL 25-7-7. Equal protection analysis, as a result, is unnecessary. The Feltmans claim that SDCL 25-7-7 does not provide for the needs of subsequent children to be taken into account when determining the amount of child support for children of a prior relationship. This is not the case. SDCL 25-7-7 requires the parents of a child to provide "for the necessary maintenance, education and support of the child in accordance with their respective means."
A parent's "respective means" is one of the factors to be considered in determining the amount of monthly support. This court held in Bruning v. Jeffries, 422 N.W.2d 579 (S.D.1988) that five factors are also to be considered in determining the amount of monthly support. One of the factors is: "(1) Financial condition of the parties, including but not limited to, income of a new spouse or contribution of a third party to the income or expenses of that parent;...." (emphasis added). If the guidelines operate to deprive children of subsequent families from necessary support, the statute permits deviation from the guidelines upon the entry of specific findings.
The child support enforcement system set forth in SDCL 25-7-7 does not disenfranchise or deny any child the right to the necessary support and maintenance that a child is entitled to from either parent. Appellants have failed to establish that the formula and scheme set forth in SDCL 25-7-7 is unreasonable or discriminatory as to them.
The judgment of the circuit court is affirmed.
Sandra Feltman has petitioned this court for an allowance of appellate attorney's fees. That petition is allowed in the amount of $750.00.
WUEST, C.J., and SABERS and MILLER, JJ., concur.
HENDERSON, J., dissents.
HEEGE, Circuit Judge, sitting for MORGAN, J., disqualified.
HENDERSON, Justice (dissenting).
Are children of a second marriage "children of a lesser god"?
Are children of a second marriage lesser children under the United States Constitution?
Are children of a second marriage any less hungry or naked without the support of their father?
Should we weep for children of a second marriage at their birth, rather than at their death?
This decision is reduced to an old adage, "First come, first served." In my judgment, all of God's children, born of the first or second marriage, must be afforded the same consideration under law.
We have, before us, yet another case where the "guidelines chart" is literally supreme. It is further noted, by this minority writer, that the majority suggests, perhaps inferentially, that the priority of the child support for the first marriage results in "imperfect results." Indeed, the law is not, perfect, but as we write it, we should strive for its perfection.
SDCL 25-7-7 is unconstitutional because it discriminates against children of a "noncustodial" *594 parent's second family, denying them equal protection under the law. This statute classifies children by accident of time of birth; a classification that has no rational relationship to any legitimate governmental interest. Conceptually, this discrimination is as irrational, and hence unconstitutional, as discrimination against illegitimate children, decried in Weber v. Aetna Cas. & Sur. Co., 406 U.S. 164, 92 S.Ct. 1400, 31 L.Ed.2d 768 (1972), and Gomez v. Perez, 409 U.S. 535, 93 S.Ct. 872, 35 L.Ed.2d 56 (1973). Courts have a very special responsibility for the care and welfare of children. Houghton v. Houghton, 37 S.D. 184, 157 N.W. 316 (1916) (children are "wards of the court"). The care and welfare of Richard's youngest children are not furthered by the rigid guidelines set out in SDCL 25-7-7, under the analysis in Donohue v. Getman, 432 N.W.2d 281, 283 (S.D.1988) (Henderson, J., specially concurring). This statute also violates the constitutional principle of separation of powers, as discussed in Sharp v. Sharp, 422 N.W. 2d 443, 448-49 (S.D.1988) (Henderson, J., dissenting), and Bruning v. Jeffries, 422 N.W.2d 579, 582-84 (S.D.1988) (Henderson, J., concurring in result).
Even were this statute constitutional, which I do not concede, the needs of Richard's later children were ignored below, requiring reversal for findings of fact and conclusions of law under the holding of the majority opinion in Bruning v. Jeffries, 422 N.W.2d at 581, where this Court remanded for "reconsideration and entry of findings regarding the totality of Father's financial condition." Dependent children must be a factor in such "financial condition."
In concluding, reference is made to my minority writing in Peterson v. Peterson, 434 N.W.2d 732, 739 (S.D.1989) (Henderson, J., concurring in part and concurring in result in part), wherein I again, as in the past, portray SDCL 25-7-7 as eroding the constitutional power of trial judges in this state and placing their discretion within the rigidity of mathematical analysis of percentages. SDCL 25-7-7 is a legal abomination which, in attempting to achieve a result, shatters due process, the constitutional Doctrine of Separation of Powers and prioritizes children in an amount of support to be received from their father depending upon when, in point of time, they were birthed. This is an attempt to achieve a social result by prioritizing children of a second or third marriage into second- or third-class citizens. And it is an injustice of mammoth proportion.
