Care of a child by the mother. Custody of a child belongs to the mother or other women relatives until the child no longer needs a woman's care, can drink and eat unassisted, can learn about other bodily functions, and can perform ablutions or purification unassisted. For a boy this is estimated at seven years of age. A girl remains under the custody of women relatives until she reaches puberty (hadd al-shahwa), when she must move to the protection of men; this is estimated to be from nine to eleven years of age, in the opinion of various legal authorities. When boys reach seven and girls nine to eleven, they are handed over to their father (or the closest male relative, according to their order of inheritance) to begin the second stage of custody, known as damm. This is according to the Hanafi code applied in most Islamic countries today. Other schools of law differ; for example, the Malikis allow a boy to remain with the mother until he reaches puberty and a girl to remain with her mother until she is married. Hadana belongs primarily to the mother, but if she remarries, she loses custody over her daughter unless the court decides otherwise. If a mother loses hadana, the child moves to the maternal grandmother; if that is not possible, then to the paternal grandmother, the maternal aunts, the paternal aunts or sisters, and so on. Damm belongs to male relatives: first the father, then the grandfather, uncle, and so on. Damm, which is enforced by the authorities if the mother refuses to surrender her children, is rationalized on the basis of a boy's need for male discipline and a girl's need for male protection at a vulnerable age before her marriage.