In the developing embryo, at the hind end lies an inpouching called the cloaca. This, over the fourth to the seventh week, divides into a urogenital sinus and the beginnings of the anal canal, with a wall forming between these two inpouchings called the urorectal septum. The urogenital sinus divides into three parts, with the middle part forming the urethra; the upper part is largest and becomes the urinary bladder, and the lower part then changes depending on the biological sex of the embryo.