In this habeas corpus proceeding petitioner sought custody of two infant children ofi the marriage between the parties. The writ was sustained, custody was awarded petitioner and respondent Was directed to pay the sum of $300 each week as and for the support of the two boys, ages five and one-half and three years.
The parties were married April 24,1966. They separated July 20, 1972, at which time a separation agreement giving custody to respondent husband was executed by the parties, each then being represented by counsel. Negotiations with respect to the *94agreement commenced sometime in November, 1971, and continued until finalized July 20,1972.
This proceeding was commenced on or about October 2, 1972. Earlier, in March, 1972, petitioner had commenced an action for divorce in which petitioner sought alimony, custody and child support. The stated ground was cruel and inhuman treatment. Subsequently, in October, 1972, petitioner served a notice of discontinuance, which notice was rejected by counsel for respondent as untimely.
In any proceeding involving custody the court must give such direction “ for the custody, care, education and maintenance of any child of the parties, as, in the court’s discretion, justice requires, having regard to the circumstances of the case and of the respective parties and to the best interests of the child. In all eases there shall be no prima facie right to the custody of the child in either parent.” (Domestic Relations Law, § 240; see, also, § 70). The court is required to “ determine solely what is for the best interest of the child, and what will best promote its welfare and happiness, and make award accordingly.” (Domestic Relations Law, § 70). The statutes state clearly that there is no prima facie right to custody in either parent.
The parties here executed an agreement for joint custody of the children, thus providing, save for physical location, that the children could share and have the benefit of the love, counsel and attention of both parents. The agreement was freely entered into. In fact, coercion is expressly disavowed by petitioner. The record reveals changes suggested by petitioner which were accepted and incorporated in the document, and that petitioner, despite an initial disavowal, came to the final conference prepared to discuss and negotiate the terms of the agreement and understood fully its contents and implications. Of course, no agreement as to custody can bind the court so as to render inoperable its supervisory power. When the court recognizes or gives attention to an agreement, it does so, “ not because the parties’ compact binds the court, but for the light it sheds on the motives and disposition of the .parties ”. (Agur v. Agur, 32 A D 2d 16, 19-20.) The court looks at the total picture and attempts to consider and weigh all factors in determining what is for the best interests of the child.
There is little doubt that the infants have the love and affection of both parents. While the parties were living together there was a governess for the children, and respondent continues -that procedure. The record reveals some testimony by respondent that petitioner believes children should be reared by govern*95esses, that it is not the responsibility of a mother to do full time work with children, and that .she felt life was passing her by because she had to spend all her time with the children. Petitioner testified that she felt a nanny (governess) should help with the chores of motherhood, but the mother is to supervise the nanny at all times. Petitioner before and during her marriage expressed a not unusual desire to work at least part time despite the ability of respondent to support his family in comfort.
Of more concern is the fact that about one week and a half after employment of a governess in 1970, petitioner took a trip to Kenya to visit her parents and was gone for a period of six weeks. Within the year petitioner took another trip of three or four weeks ’ duration to London, Germany and Kenya. During this time respondent and the governess cared for the infants, one of whom was of a very tender age. While petitioner was away on the first trip, the governess became ill, and because she was absent for a week, it was necessary for respondent to obtain a replacement for that period. The governess had completé charge of the children. She took care of their clothing, their rooms, meals, exercise and recreation. The older boy would eat breakfast with his father and usually greet him at the door upon his return from work.
Petitioner supervised the children’s education, purchased their food, upon occasion instructed what petitioner desired for their dinner and, once in a while, played with them in the presence of the governess.
The children were born in the United States; this is their home. The respondent is a .successful businessman, devoted to the children. The apartment in which they reside appears from the pictures and the description to be spacious, comfortable and well-furnished. By the terms of the agreement petitioner had almost unlimited visitation rights which petitioner exercised without hindrance.
Petitioner, age 30, is somewhat younger than respondent. The extramarital relationship revealed by the record cannot be disregarded entirely in considering whether there will be a stable home life for the infants. It has been held that a single act of adultery is not a sufficient basis upon which to deny custody to a mother (Shell v. Sheil, 29 A D 2d 950), though the past conduct of a party or an affair of extended duration warrants closer scrutiny and greater consideration. (Harrington v. Harrington, 290 N. Y. 126; see Johnson v. Johnson, 47 Misc 2d 805, affd. 25 A D 2d 672.) Disregarding all else, such an affair could affect the availability of a parent when .such parent’s presence is *96vitally necessary. The contemplated trip referred to in the record, abandoned apparently, upon discovery, is a factor for concern. The infants’ welfare was not then paramount. Also, the circumstances of the act or acts involved could raise a question of the importance of priorities.
Petitioner, having consented to custody in respondent, has shown nothing to warrant a change. Certainly, there is nothing in the record which even indicates they are not being well cared for, loved, protected and in the process of starting, for the older boy, the educational process. Respondent is shown to be in every way a fit custodian and father. Indeed petitioner does not really charge the contrary.
For all the reasons heretofore stated, the judgment entered April 9, 1973, in New York County (Rosenberg, J.) which sustained a writ of habeas corpus, should be reversed on the law, the facts and in the exercise of discretion, and the petition should be dismissed without costs.