The most primitive ray finned fishes retain the simple structure also found in lungfishes, but in teleosts, folds of peritoneum enclose the ovary and upper part of the tube, fusing them into a single structure. The ovary itself is hollow, with eggs being shed into the central cavity, and thence passing directly into the oviduct. The enclosed nature of the female reproductive system in these fishes makes it impossible for eggs to escape into the general body cavity; a necessary development given that thousands or even millions of eggs may be released in a single spawning.