Cognitive impairment occurs frequently after surgery in the approximately 400,000 patients who undergo cardiac operations each year. An increasing number of these patients are elderly, and we have found that this patient population is particularly susceptible to cognitive dysfunction after cardiac surgery. Cognitive impairment is most notable in the early phases after cardiac surgery, but persistence occurs in an important percentage of patients. While adjectives such as """"""""subtle,"""""""" """"""""transient,"""""""" and """"""""subclinical"""""""" have been used due to the apparent transient nature of decline, we have identified that perioperative decline is associated with five year cognitive deterioration and reduced quality of life. Multiple strategies, both clinical and pharmacological, have been proposed to reduce the central nervous system dysfunction associated with cardiac surgery. However, most have been unsuccessful, met with very limited success, or are unrealistic from a cost or risk-benefit ratio to be applied to the majority of patients. We will test the ability of supplemental magnesium, achieving plasma levels 2x normal, to provide protection from neurocognitive decline in patients undergoing cardiac surgery. This clinical trial will enroll 400 patients over approximately 48 months. A battery of neurocognitive tests as well as a neurologic assessment will be completed at baseline, discharge, 4 - 6 weeks, and one year postoperatively. Our multidisciplinary research team has extensive experience in assessing neurocognitive decline both short and long-term after cardiac surgery, will allow this project to be accomplished expeditiously both as a pilot clinical and following efficacy trial. Multiple animal studies demonstrate a benefit of magnesium in focal and global models of ischemia. Although still early in enrollment, the Interventional magnesium stroke study (IMAGES) has yielded promising results. Little is more devastating to a patient, the patient's family or those caring for a patient than to have a successful operation that prolongs life, but diminishes the quality of that prolonged life. Nothing is more likely to adversely impact the quality of life than deterioration in a patient?s mental status, particularly those higher faculties that we call cognition. Therefore, we will also determine if magnesium bolus plus infusion given perioperatively can improve quality of life through improved cognitive performance. We propose that magnesium, through one of a number of potential mechanisms will allow us to alter susceptibility to neurocognitive dysfunction and thereby prevent this tragic consequence in the aging population.