The function of hemoglobin in the body is :