The eggs are derived from materials ingested as a larva and in some species, from the spermatophores received from males during mating. An egg can only be 1/1000 the mass of the female, yet she may lay up to her own mass in eggs. Females lay smaller eggs as they age. Larger females lay larger eggs. The egg is covered by a hard-ridged protective outer layer of shell, called the chorion. It is lined with a thin coating of wax, which prevents the egg from drying out. Each egg contains a number of micropyles, or tiny funnel-shaped openings at one end, the purpose of which is to allow sperm to enter and fertilize the egg. Butterfly and moth eggs vary greatly in size between species, but they are all either spherical or ovate.