The kidneys are small bean-shaped organs and consist of two main layers, an inner layer called the medulla and an outer layer called the cortex. They help control the chemical balance of the blood and regulate the body's level of sodium, potassium and calcium. The kidneys make two main hormones, vitamin D and erythropoietin. Vitamin D is essential for a number of different functions in the body. Active vitamin D stimulates the uptake of calcium from food, is important for the maintenance of healthy bones and also helps to regulate the response of the immune system to infection. Erythropoietin is produced when oxygen levels in the blood are low. It acts in bone marrow to stimulate the production of mature red blood cells, to maintain healthy oxygen levels in our tissues.