The pancreas functions as both an exocrine and endocrine gland. As an exocrine gland, it produces buffers and enzymes that help digest carbohydrates, fats, and proteins in the small intestine. As an endocrine gland, it produces the hormones insulin and glucagon which regulate blood glucose levels. Diseases that can affect the pancreas and its function include diabetes mellitus, pancreatitis, and pancreatic cancer. Diabetes occurs when the pancreas does not produce enough insulin or the body does not properly use insulin.