The functions of the liver include filtering and breaking down harmful substances from the blood which are then removed from the body in urine and stools, production of bile that helps to digest foods like fat; storing glycogen which can be used for energy, converting nutrients from the food into essential blood components, regulating clotting of blood, maintaining hormone balances, producing factors that help the immune system to fight infection, and removing bacteria from the blood.