
257 N.W.2d 731 (1977)
Joan Ann KESTER, Plaintiff and Appellant,
v.
Richard Lee KESTER, Defendant and Respondent.
No. 11996.
Supreme Court of South Dakota.
Argued September 14, 1977.
Decided September 28, 1977.
Fred M. Winkler of Lynn, Jackson, Shultz, Ireland & Lebrun, Rapid City, for plaintiff and appellant.
*732 William H. Coacher, Sturgis, for defendant and respondent.
DUNN, Chief Justice.
This is an appeal from a judgment entered by the Circuit Court of the Seventh Judicial Circuit granting custody of a minor child[*] to the father, Richard Kester, on May 6, 1976. The father had also been awarded temporary custody of the child pending trial of the matter. The parties were both granted a divorce on the grounds of mental cruelty, but that part of the judgment is not being appealed. We reverse and direct the trial court to modify its judgment and decree of divorce to grant custody of the minor child of tender years to the mother, Joan Kester.
The evidence put on at trial by the plaintiff was that she has her own apartment, a steady job at the Custer State Hospital and has made arrangements with another woman to baby-sit while she works. The plaintiff, along with other witnesses, testified that defendant Richard Kester drinks heavily and that while drunk he had driven around in a pickup truck in which he had a loaded gun with his daughter present. According to witnesses, he had tried to run over plaintiff with his truck. The defendant admitted the incident, but said that he was just trying to talk with her. He was called as a hostile witness, and he admitted that he had moved the child four times in as many months while he was looking for work. The father and daughter normally stay with friends or relatives while he works at a temporary job. He also admitted taking the child from the mother and hiding her when he knew she was on medication without bothering to bring the medicine along. The testimony also revealed that defendant has a fifth grade education and cannot read or write, except his name. The plaintiff has completed the eighth grade.
The main emphasis of the defendant's evidence dealt with two alleged incidents of immoral conduct by plaintiff. The first incident involved the presence of the plaintiff and John (Ivan) Hebbring in a motel room where the Kesters were living. It was a one-room unit, the only furniture on which to sit being the bed and a chair. The witness found the two people in the room fully clothed, one standing and one sitting on the bed at 10 a. m. The child was asleep at the time. The witness stated she saw nothing immoral, but she testified that Hebbring asked her not to tell anyone, because they might get the wrong idea. The plaintiff admitted the incident, but she said Hebbring had merely come over to ask if she wanted to go to Rapid City for the day with him and his wife.
The second incident was testified to by defendant's brothers. They claimed that they came across plaintiff and Hebbring parked in the woods one afternoon with the child asleep in the back of the vehicle. The two were fully clothed, but Hebbring's shirt was unbuttoned. The plaintiff allegedly ducked low in the seat and hid her head when the two brothers showed up. Hebbring's boss testified that Mr. Hebbring was cutting trees in Wyoming when this incident was supposed to have occurred. He based his testimony on pay records and not personal recollection. Hebbring's brother confirmed this testimony. The plaintiff denied the second incident completely.
Other testimony indicated that plaintiff drank in public and was occasionally drunk. She did not make breakfast for defendant during the last month or so of her pregnancy. Defendant testified that plaintiff would leave home at night and tell him it was his turn to take care of the baby. There was testimony that plaintiff left him with the baby when she was feverish and that plaintiff became angry when defendant took the baby to a doctor. The child was allegedly disciplined once by "sitting her down hard" on the floor. All of the witnesses, however, stated that the plaintiff was a good housekeeper and loved the child *733 and took good care of her. Even the defendant admitted this.
The trial judge concluded that all things were not equal under SDCL 30-27-19, South Dakota's "tender years" statute, and awarded custody of the young child to the father. The reasons for his decision, as set out in the memorandum decision and findings of fact, are as follows:
(1) The child was present at the time of the two incidents involving the plaintiff and another man, and this was "not in the best interests of this child;"
(2) The plaintiff absented herself from home, leaving the child with the father, and stayed out late;
(3) The plaintiff refused to fix breakfast for the child;
(4) The plaintiff "threw" the child to the floor to discipline her;
(5) The plaintiff became angry when the defendant took the child to the doctor for treatment of a mild fever;
(6) The child would be "brought up" in the home of the plaintiff's alleged paramour, who allegedly had beaten one of his children, several years before; and
(7) The child exhibited a much stronger attachment to her father in the courtroom.
SDCL 30-27-19(2) reads as follows:
"As between parents adversely claiming the custody or guardianship, neither parent is entitled to it as of right, but, other things being equal, if the child be of tender years, it should be given to the mother * * *."
This court has stated that the trial court has a broad discretion in matters of awarding custody of children of tender years, but it is a judicial discretion, not an uncontrolled one, and its exercise must have sound and substantial basis in the testimony. Masek v. Masek, 1975, S.D., 228 N.W.2d 334, 337. We conclude that the trial court's determination does not have a sound and substantial basis in testimony.
Several of the court's findings are not supported by any evidence in the record. There is no evidence to support the finding that plaintiff refused to fix breakfast for the child. The only testimony pertained to her not fixing breakfast for defendant while she was pregnant with the child and suffering from morning sickness. The child would not be "brought up" in the paramour's home. The only evidence here was that the plaintiff planned to use Mrs. Hebbring as a baby-sitter while plaintiff was at work, and at a time when the so-called paramour would also be working. There is no evidence in the record of the child's preference for the defendant in the courtroom or otherwise, and such evidence, if available, would be of little probative value in view of the period of time that defendant had temporary custody with the child spending little or no time with plaintiff. The findings that on one occasion plaintiff "threw" the child to the floor and became angry when defendant took the child to a doctor for a mild fever have support in the record, but they can hardly be controlling in view of defendant's admitted use of corporal punishment on the child and his forcibly taking her from plaintiff when she was under medication and hiding her for a time without providing the proper medication. There was evidence of drinking by both parties, but here again under the "all things being equal" criterion, there is evidence that defendant became violent while drinking and that he actually endangered the child's life by driving around with her in a pickup truck in which he had a loaded gun.
We now turn to the two incidents where there was testimony of plaintiff having been found with Hebbring while the baby was present. The trial court gave great significance to these incidents. In the first place, it must be pointed out that the proof of plaintiff's immoral conduct is very weak. The witness to the incident in plaintiff's motel home admitted that nothing immoral was observed, and the time records of Hebbring had him forty miles away at the time of the alleged incident in the woods. But assuming that some "hanky-panky" *734 was going on between the plaintiff and Hebbring, the trial court completely confused marital responsibilities with parental responsibilities.
The conclusion that the child was harmed in any way by being present during the times when the plaintiff was allegedly observed with her paramour is likewise unsubstantiated in the record. Where a mother has been guilty of marital misconduct and there is no evidence of demonstrable effect of such conduct upon the child, it does not follow that she is an unfit person to have custody and that an award of custody to her is not in the best interest and welfare of the child. Wiesner v. Wiesner, 1963, 80 S.D. 114, 119 N.W.2d 920; Hershey v. Hershey, 1970, 85 S.D. 85, 177 N.W.2d 267. The child was six months old at the time of the first incident and nine months old at the time of the second, so it is difficult to see how the child was affected by any immoral conduct, even if such conduct did occur. The court stated in Yager v. Yager, 1968, 83 S.D. 315, 159 N.W.2d 125, that the fact that children, because of their ages, do not understand the improprieties of their mother is not determinative of the custody question, but we feel that one seeking to take custody from a mother has a burden of showing a harmful effect on the children caused by the mother's conduct.
Accordingly, we conclude that the testimony reveals that all things were not equal but were strongly balanced in favor of the plaintiff having custody of the child. She has a steady job, a permanent home, and she has shown an inclination and ability to properly care for the child. The defendant has no permanent job, no home, and he has actually imperiled the life of the child at times by his drinking and his lack of concern for her welfare while she was under medication.
Therefore, we reverse and direct the trial court to modify its judgment and decree of divorce by granting custody of this child of tender years to the plaintiff.
All the Justices concur.
NOTES
[*]  The child will be four years old in October of 1977, and both parties concede that she is of "tender years."
