
329 Md. 677 (1993)
621 A.2d 427
ANNE ARUNDEL COUNTY, MARYLAND
v.
HARTFORD ACCIDENT AND INDEMNITY COMPANY.
No. 118, September Term, 1992.
Court of Appeals of Maryland.
March 24, 1993.
David A. Plymyer, Deputy County Atty. (Judson P. Garrett, Jr., Anne Arundel County Atty., and John F. Breads, Jr., Asst. County Atty., all on brief), Annapolis, for appellant.
William K. Dove, II, on brief, Fairfax, VA, for appellee.
Argued before ELDRIDGE, RODOWSKY, McAULIFFE, CHASANOW, KARWACKI, ROBERT M. BELL and CHARLES E. ORTH, Jr., Judge of the Court of Appeals (Retired, Specially Assigned), JJ.
ORTH, Judge.
For a decade James G. Lowe was employed by Anne Arundel County as the Superintendent of Downs Park, owned by the County. He took advantage of his position by stealing $88,286 of County funds. He was duly charged, and at trial in the Circuit Court for Anne Arundel County he entered a plea of guilty of felony theft. He was sentenced to imprisonment for a term of five years. The sentence was suspended, and he was placed on probation for five years. One of the conditions of probation was that he make restitution to Anne Arundel County in the amount of $25,000. Although the probation order is not included in the record before us, it appears that Lowe was to make monthly payments to the Division of Parole and Probation to be forwarded to the victim, Anne Arundel County.

I
Anne Arundel County was the insured or obligee under a bond issued by the Hartford Accident and Indemnity Company (the insurer or surety) in the penalty of $1,000,000 which covered Lowe's thievery. The bond included a rider with a "Deductible Amount" of $25,000, so that the insurer was liable only for a loss in excess of that amount and "then for such excess only, but in no event for more than the [$1,000,000 indemnity]." Paragraph 1. Paragraph 2 of the rider provided, in relevant part, that, if the insured suffers a loss within the indemnity amount, "all recoveries made after payment by the Surety of loss covered by this bond"
shall be applied first in reimbursement of the Surety and thereafter in reimbursement of the Obligee or insured for that part of such loss within such Deductible Amount.
The record contains an affidavit by the prosecutor in the criminal cause in which he stated:
Per my discussions with the representatives of the County, and the Court, the restitution figure represented the amount of the deductible under the County's policy with its insurer. Accordingly, the restitution figure was designed to compensate the County for the amount not actually paid to it by its insurer.
Honoring the bond, the insurer paid the County $63,286, the amount of the loss less the $25,000 deductible.
Thereafter, counsel for the insurer wrote the Assistant County Attorney, enclosing a copy of the deductible rider. Counsel for the insurer pointed out:
As you can see, paragraph two of said Rider provides that, "if there be no excess loss, any such recoveries shall be applied first in reimbursement of the Surety and thereafter in reimbursement of the Obligee or Insured for that part of such loss within such Deductible Amount." The County's claim of $88,286.00 does not consist of an excess loss since the Bond in question has a $1,000,000.00 policy limit. Accordingly, The Hartford maintains a right of first recovery for its payment of $63,286.00.
He requested:
Would you please contact the necessary individuals to determine the amount of restitution thus far received by Anne Arundel County for James Lowe. Afterwards, would you then please issue my office a check for this amount, payable to William K. Dove, II on behalf of The Hartford. Moreover, it is requested that the County take whatever necessary steps to insure that all further restitution payments are likewise issued to my office on behalf of The Hartford.
He suggested, "Should you have any questions regarding the above, please feel free to call."
The Assistant County Attorney did not share the view of the insurer's counsel. He sent the insurer's counsel a copy of Art. 27, § 640 of the Maryland Code. He pointed out:
As you can see, the law clearly distinguishes categories of individuals or entities to whom restitution may be ordered by the court. Specifically, § 640(b)(3) allows the court to distinguish between those payments which would go to the direct victim of a crime and those which would be made to a third-party payor, including an insurer which has made payment to the victim to compensate the victim for a property loss. Moreover, subsection (b)(4) mandates that the court give priority in payment of restitution to the victim unless the victim has been fully compensated for the loss by a third party payor.
(Emphasis in original). He explained, "In this instance, the court ordered that restitution be made to the victim (Anne Arundel County) and not to the insurer." He observed that the $25,000 restitution amount "represented the out-of-pocket loss to the County." He noted that the attorney then representing the insurer "was fully aware of the ongoing criminal proceeding and had every opportunity to advise [the prosecutor] or the court that the insurer believed any restitution amount should be paid directly to it." He rejected, "[u]nder the circumstances," the demand that the County "forward any restitution payments to you on behalf of [the insurer]."
The insurer filed suit in the Circuit Court for Anne Arundel County against the County. The first eight paragraphs of the Complaint as amended set out the facts surrounding the loss sustained by the County by reason of Lowe's conduct, and called attention to the obligation of the insurer under the bond, including the deductible rider, and asserted that by reason of its obligation the insurer had paid the County $63,286, representing the County's loss less the deductible sum of $25,000. Paragraph 9 alleged that in exchange for the insurer's payment the County had assigned to the insurer all its rights to all money recovered by reason of the proof of loss. The Release and Assignment document was made a part of the Complaint. Paragraphs 10 and 11 claimed that Lowe "has been making and continues to make restitution payments to Anne Arundel," in an amount which at that time totaled about $7,000. Paragraphs 12-16 alleged that "the Bond, the Deductible Rider, and the Release and Assignment, each establish and define a contractual relationship between [the insurer] and Anne Arundel County," that the insurer has a right of first recovery on the sums recovered in connection with the loss, that the County has refused to pay the sums, that the retention of the sums constituted a breach of contract, and that the stated intention of the County to retain the sums recovered from Lowe constitutes an anticipatory breach of contract. "Wherefore," the insurer requested,
judgment be entered against Anne Arundel County in the amount of Twenty-five Thousand Dollars ($25,000.00) with interest from the date of judgment, together with its costs hereby expended....
Paragraphs 17 and 18 of the Amended Complaint requested that a declaratory judgment be entered against the County in the amount of $25,000 and that the County
be ordered prospectively to pay to the [insurer] any and all sums it receives from James G. Lowe in restitution of monies embezzled from [the County] as and as soon as said monies are paid to the County. .. .
The Release and Agreement made a part of the Amended Complaint by paragraph (1) released the insurer from all liability under the bond by reason of the loss. Paragraph (2) read:
The Insured has assigned and does hereby assign, sell, transfer and set over to the Surety all its rights, title and interest in relation to any and all items claimed in and by the said proof of loss, and all money that may be recovered by reason thereof.
It was signed by the Director of Administration of the County and acknowledged before a Notary Public as the free act and deed of the signers and sealers and the free act and deed of the County.
The County moved for Summary Judgment, and the insurer filed a cross-motion for Summary Judgment. After a hearing on the motions, the Circuit Court for Anne Arundel County denied the County's motion and granted the insurer's motion. It entered judgment in favor of the insurer "as to the relief sought in the Amended Complaint...." It "specifically" ordered the County
to pay [the insurer] all sums paid to or recovered to date [23 June 1992] to [the County] from James G. Lowe, including restitution paid through the Department of Parole and Probation, said sums totaling $16,323.07.
The County noted an appeal to the Court of Special Appeals. We certified the case to us on our own motion prior to decision by the intermediate appellate court.

II
The County stated in its brief:
It is the County's position that Hartford's "right of first recovery" under the contractual language of the Deductible Rider does not extend to restitution payments made to the County as a victim of a crime. The County does not contest Hartford's right under this contractual language to "any such recoveries" other than criminal restitution.[3][[1]]
(Emphasis in original). "In other words," the County continued, Md.Code (1957, 1992 Repl.Vol.) Art. 27,
§ 640(b)(4) renders void and unenforceable the contract provision only insofar as the provision embodies an agreement that the insurer has the right to restitution proceeds; to the extent that the same provision reflects the parties' intent concerning other recoveries, the statute is inapplicable.
At the time this case was before the circuit court, Section 640(b)(4) provided:
If the victim has been fully compensated for the victim's loss by a third-party payor, the court may order restitution to the third-party payor. Otherwise, payment of restitution to the victim has priority over payment of restitution to the third-party payor.
It is the County's view that paragraph (2) of the rider and paragraph (2) of Release and Assignment were invalidated as against public policy in light of the statute providing restitution for victims.

A
In Coles v. State, 290 Md. 296, 429 A.2d 1029 (1981), we outlined the economic and penological aims sought to be accomplished by ordering a person convicted of crime to repay his victim.
A court which orders restitution does a certain solomonic justice for the aggrieved victim who is entitled to requital of that unlawfully taken or reparation for injury criminally inflicted; thus, restitution as a probationary tool has an understandable appeal.
Id. at 305, 429 A.2d 1029. "Its significance extends beyond untinseled justice," we observed, "for it should be viewed more expansively as an aid in rehabilitating the defendant."
Id. We pointed to what one court stated:
[Restitution] offers the individual something within reason that he can do here and now, within the limits of his ability to demonstrate to himself that he is changing. A fine is punitive. A jail sentence is retributive. But restitution makes sense. It is every man's obligation to meet responsibilities of this sort in civil life. [State v. Harris, 70 N.J. 586, 362 A.2d 32, 35 (quoting D. Dressler, Practice and Theory of Probation and Parole 176-77 (1959) (emphasis in original).]
Id. 290 Md. at 305-306, 429 A.2d 1029. Noting that a court's concern that the victim be fully compensated should not overshadow its primary duty to promote the rehabilitation of the defendant, we stated:
Should the court choose to impose restitution, this fundamental objective of promoting rehabilitation comes to the fore and the court in ordering such a condition ordinarily should not exceed the defendant's ability to comply.
Id. at 306, 429 A.2d 1029. "This is so," we explained,
because if the amount fixed exceeds the defendant's resources, the rehabilitative purpose of the sentence is frustrated, especially where restitution is set as a condition of probation, "for in such a case the defendant is told that he will not be imprisoned only if he somehow satisfies a condition he cannot hope to satisfy."
Id. (citations omitted).
Consequently, most courts which have considered the issue have determined that it is improper for a trial court to order restitution without basing that judgment on a reasoned inquiry into the defendant's ability to pay, ...
Id. (citations omitted).
Thus, as we observed in Lee v. State, 307 Md. 74, 78, 512 A.2d 372 (1986), it is "widely recognized" that "the fundamental purpose" of ordering restitution as a condition of probation is "rehabilitating the defendant and affording the aggrieved victim recompense for monetary loss." We thought that "the General Assembly clearly intended the attainment of these objectives when it enacted Maryland's restitution statute...." Id. at 79, 512 A.2d 372. Another objective of restitution is to provide a form of punishment for criminal conduct. Songer v. State, 327 Md. 42, 46, 607 A.2d 557, 607 A.2d 557 (1992); Spielman v. State, 298 Md. 602, 610, 471 A.2d 730 (1984). For a general discussion on the purposes of restitution and its place in the criminal justice system, see Note, Victim Restitution in the Criminal Process: A Procedural Analysis, 97 Harvard L.Rev. 931 (1984).
The objectives of restitution do not include that the victim must be made whole by the full reimbursement of the victim's loss, but they do not preclude that possibility if the defendant has the ability to pay.

B
Over a century ago this Court said:
[T]he right of parties to contract as they please is restricted only by a few well defined and well settled rules, and it must be a very plain case to justify a court in holding a contract to be against public policy.
Estate of Woods, Weeks & Co., 52 Md. 520, 536 (1879). We emphasized:
It must be a case in which the common sense of the entire community would so pronounce it.
Id. We find no departure from this view over the years. In Baltimore v. Md. Casualty Co., 171 Md. 667, 673, 190 A. 250 (1937), the Court observed, quoting Casualty Insurance Company's Case, 82 Md. 535, 574, 34 A. 778 (1896):
"Speaking generally, the principle which holds that no one can lawfully do that which has a tendency to be injurious to the public, or against the public good, may be termed the policy of the law or public policy in relation to the administration of the law."
The Court noted that in Casualty Insurance Company's Case, it "quoted with approval this extract from Richardson v. Mellish, 2 Bing, 229, 130 Eng.Rep. 303:"
"I, for one, protest, as my Lord has done, against arguing too strongly upon public policy; it is a very unruly horse and when once you get astride it you never know where it will carry you. It may lead you from the sound law. It is never argued at all but when other points fail."
171 Md. at 673, 190 A. 250. Md.-Nat'l Cap. P. & P. v. Wash. Nat'l Arena, 282 Md. 588, 386 A.2d 1216 (1978), in an exposition of "public policy," pointed out:
Fearing the disruptive effect that invocation of the highly elusive public policy principle would likely exert on the stability of commercial and contractual relations, Maryland courts have been hesitant to strike down voluntary bargains on public policy grounds, doing so only in those cases where the challenged agreement is patently offensive to the public good, that is, where "the common sense of the entire community would ... pronounce it" invalid.
Id. at 606, 386 A.2d 1216, quoting Weeks, 52 Md. at 536 (other citations omitted). We explained:
This reluctance on the part of the judiciary to nullify contractual arrangements on public policy grounds also serves to protect the public interest in having individuals exercise broad powers to structure their own affairs by making legally enforceable promises, a concept which lies at the heart of the freedom of contract principle.
282 Md. at 606, 386 A.2d 1216 (citations omitted). We concluded:
In the final analysis, it is the function of a court to balance the public and private interests in securing enforcement of the disputed promise against those polices which would be advanced were the contractual term held invalid. Enforcement will be denied only where the factors that argue against implementing the particular provision clearly and unequivocally outweigh "the law's traditional interest in protecting the expectations of the parties, its abhorrence of any unjust enrichment, and any public interest in the enforcement" of the contested term.
Id. at 607, 386 A.2d 1216. In First Nat'l Bank v. Fid. & Dep. Co., 283 Md. 228, 239, 389 A.2d 359 (1978), we quoted Patton v. United States, 281 U.S. 276, 50 S.Ct. 253, 74 L.Ed. 854 (1930):
"The truth is that the theory of public policy embodies a doctrine of vague and variable quality, and, unless deducible in the given circumstances from constitutional or statutory provisions, should be accepted as the basis of a judicial determination, if at all, only with the utmost circumspection. The public policy of one generation may not, under changed conditions, be the public policy of another."
We cited to Funk v. United States, 290 U.S. 371, 381, 54 S.Ct. 212, 215, 78 L.Ed. 369 (1933), as to like effect. We expressed this view again in Adler v. American Standard Corp., 291 Md. 31, 432 A.2d 464 (1981). We acknowledged our awareness that "recognition of an otherwise undeclared public policy as a basis for a judicial decision involves the application of a very nebulous concept to the facts of a given case, and that declaration of public policy is normally the function of the legislative branch." Id. at 45, 432 A.2d 464. See also Bethlehem Steel v. G.C. Zarnas & Co., 304 Md. 183, 190, 498 A.2d 605 (1985) (Legislature "expressly stated" that certain indemnity provisions in construction contracts are "against public policy"); Jones v. Malinowski, 299 Md. 257, 273, 473 A.2d 429 (1984). In Adler we concluded:
We have been consistently reluctant, for example, to strike down voluntary contractual arrangements on public policy grounds.
291 Md. at 45, 432 A.2d 464 (citations omitted). Cf., Felder v. Butler, 292 Md. 174, 183, 438 A.2d 494 (1981). And as the relationship between a statutorily-based public policy and a provision in a contract grows more attenuated, this Court's reluctance to invalidate the contractual provision on public policy grounds increases. Finci v. American Casualty, 323 Md. 358, 378-379, 593 A.2d 1069 (1991).

III
The convicted thief, Lowe, has no interest whatsoever in this case. The "fundamental purpose" of the restitution statute is being fulfilled by Lowe's compliance with the court's order for restitution payments. No matter who ultimately gets the payments he makes, he is being rehabilitated and punished by the mere making of them. When his payments amount to $25,000, the restitution condition of his probation will have been met whether the monies end up in the hands of the County or the insurer. The dispute between the County and the insurer in no way affects Lowe or his obligation under the statute. Conversely, Lowe's obligation to make the restitution payments has no impact on the dispute between the County and the insurer.

A
The statute authorizes the court to "order that restitution be made to:"
(i) The victim;
(ii) The Department of Health and Mental Hygiene, the Criminal Injuries Compensation Board, or any other governmental entity; or
(iii) A third-party payor, including an insurer, which has made payment to the victim to compensate the victim for a property loss or pecuniary loss....
Art. 27, § 640(b)(3). As we have seen, the statute places a restraint on the court's discretion to designate the third-party payor as the payee. Payment of restitution to the victim has priority over payment to the third-party payor unless the victim has been fully compensated for the victim's loss by the third-party payor. § (b)(4). But there is legislative silence as to any restraint with respect to the disposition of the restitution payments received by the payee, be it the victim, a governmental agency, or the third-party payee. Therefore, if the victim is the payee, the victim is in no way fettered in the disposition of the money received. The money may be disposed of at the whim of the victim, foolishly or wisely, prudently or wantonly. If the victim chooses to give the money received to the third-party payor by way of a valid contract, release or assignment, there is no statutory prohibition to deter the victim from doing so.
The County mounts the public policy horse in its attempt to invalidate the disputed provisions in the rider accepted by the County and the Release and Assignment executed by the County. We find no declaration in the restitution statute or in the preamble to House Bill 1680, which was the source of the statute, that the enactment of the statute reflected public policy. We note that restitution is not mandatory; it does not apply to all defendants whose criminal conduct has caused loss to a victim. An order for restitution is at the discretion of the judge and, if ordered, the amount of restitution is dependent on the ability of the defendant to pay. As we have observed, an objective of the statute was to afford a victim recompense for monetary loss, but the Legislature did not go so far as to require that the victim be made whole by full reimbursement of the victim's loss. But even if restitution for crimes were a matter of public policy, we do not believe that the challenged agreements are "patently offensive to the public good, that is, where `the common sense of the entire community would pronounce them invalid,'" as we said in Md.-Nat'l Cap. P. & P., 282 Md. at 606, 386 A.2d 1216. On the contrary we think that to invalidate them, even only with respect to the $25,000 deductible amount which the County seeks, would improperly infringe on "the public interest in having individuals exercise broad powers to structure their own affairs by making legally enforceable promises, a concept which lies at the heart of the freedom of contract principle," id. at 606, 386 A.2d 1216. In the exercise of our function to balance the public and private interests served in the enforcement of the disputed promises against those policies which would be advanced were the contractual terms held invalid, we find no compelling factors that argue against implementing the disputed rider provision and the release and assignment which clearly and unequivocally outweigh the law's traditional interest in protecting voluntary contractual arrangements. It is correct, of course, that the Legislature, in Art. 27, § 640(b)(4), gave priority to the victim to receive the restitution payments ordered by the court until the victim had been "fully compensated." But this does not mean that the victim was therefore fettered in the disposition of the payments. We do not believe that public policy is one whit undermined by the County's relinquishment and assignment of its interest in the restitution payments to the insurer.
In the circumstances of this case, we are as reluctant, as we have so often been in the past, to strike down voluntary contractual arrangements on public policy grounds. The County under the restitution statute had the right to the $25,000 deductible amount which was not paid by the insurer. But it voluntarily and freely relinquished that right, not once but twice. The County is a sophisticated government agency which dealt at arm's length with the insurer in negotiating and accepting the provisions it now disclaims. It becomes unhorsed when it attempts to ride the unruly public policy horse to justify its complaint.
It may be that the trial judge reached his decision in part for the wrong reason, but the decision he reached was the right one.[2]See Robeson v. State, 285 Md. 498, 502, 403 A.2d 1221 (1979), cert. denied, 444 U.S. 1021, 100 S.Ct. 680, 62 L.Ed.2d 654 (1980). Accordingly,
JUDGMENTS OF THE CIRCUIT COURT FOR ANNE ARUNDEL COUNTY AFFIRMED WITH COSTS.
NOTES
[1]  The County conceded in its footnote 3,

that this "right of first recovery" applies to the pension contributions, unpaid disability and annual leave, and final paycheck for Mr. Lowe which were retained by the County as a set-off against the theft loss caused by Mr. Lowe.
[2]  The County argued that the trial judge "found, without evidentiary support, that the County had gotten the benefit of a `lower premium' for its insurance in return for assigning its rights to restitution to [the insurer]."

The insurer disputed this view, and claimed that the fact that the County had gotten the benefit of a "lower premium" in light of the rider is "fully supported by the record." The insurer points to a footnote in the County's brief as conceding this. The County admitted:
It is not completely clear from [the trial judge's remarks] whether he assumed only that the County had paid a lower premium because of the deductible, and general assignment of rights, or whether he also assumed that the County had paid a lower premium because of the specific assignment of restitution proceeds. The County concedes here, as it did below, that the deductible and the general assignment of rights were part of the consideration for the fidelity bond.
But, the County added, what it did not concede is that "the availability vel non of restitution as part of the assignment of rights somehow affected the premium charged to the County."
