Thanatology is the scientific study of death, including the cause, phenomena, and postmortem changes. Death occurs in two stages - somatic/systemic and molecular/cellular. Somatic death is the irreversible cessation of circulatory and respiratory functions. Molecular death occurs piecemeal as tissues die at different rates. The time since death can be estimated by changes including algor mortis (cooling of the body), livor mortis (postmortem staining), and rigor mortis. Accurately determining the time and cause of death is important for legal and medical reasons.