magnesium as a cofactor for DNA repair and ATP production