In flowers, the surviving haploid spore inside of the ovule undergoes 3 cycles of mitosis and the resulting structure is the embryo sac; i.e., female gametophyte. This embryo sac consists of seven cells. How do you get seven cells from the 3 cycles of mitosis.

Furthermore, of the seven cells one is an egg cell and one is a large cell containing two haploid nuclei.

How does this happen?