Vermiform appendix , in anatomy, a vestigial hollow tube that is closed at one end and is attached at the other end to the cecum , a pouch like beginning of the large intestine into which the small intestine empties its contents. Its function is to house and cultivate beneficial gut flora that can repopulate the digestive system following an illness that wipes out normal populations of this flora; providing a site for the production of endocrine cells in the fetus that produce molecules important in regulating homeostasis . It serves a role in immune function during the first three decades of life by exposing leukocytes (white blood cells) to antigens in the gastrointestinal tract, thereby stimulating antibody production that may help modulate immune reactions in the gut. Blockage of the appendix can lead to appendicitis, a painful and potentially dangerous inflammation The appendix is usually 8 to 10 cm (3 to 4 inches ) long and less than 1.3 cm (0.5 inches) wide . The cavity of the appendix is much narrower where it joins the cecum than it is at its closed end. The appendix has muscular walls that are ordinarily capable of expelling into the cecum the mucous secretions of the appendiceal walls or any of the intestinal contents that have worked their way into the structure. If anything blocks the opening of the appendix or prevents it from expelling its contents into the cecum , appendicitis may occur. The most common obstruction in the opening is a fecalith , a hardened piece of faecal matter. Swelling of the lining of the appendiceal walls themselves can also block the opening. When the appendix is prevented from emptying itself, a series of events occur. Fluids and their own mucous secretions collect in the appendix, leading to edema, swelling, and the distention of the organ . As the distention increases, the blood vessels of the appendix become closed off , which causes the necrosis (death) of appendiceal tissue. The basic treatment of appendicitis is the surgical removal of the appendix in a minor operation called an appendectomy.