Inclusion Criteria.  Patients aged 18 to 80 years Belonging to American Society of Anesthesiologists physical status (ASA) I, II Undergoing elective spine or cranial surgery where intraoperative neuromonitoring including short latency somatosensory evoked potentials (SSEP or SEP) and transcranial electrical muscle motor evoked potentials recording from muscles (TceMEP or TcMEP or mMEP or MEP) is planned.  Exclusion Criteria:  Magnesium use within the last 2 days, either intravenous or oral supplements. Patients with known electrolyte imbalances (Sodium <135 or >145 mmol/L OR Potassium < 3.5 or > 5.0 mmol/L, Magnesium >1.2 mmol/L. Severe cardiac or cardiac conduction disorders. Severe pulmonary disease. Patients with significant neuromuscular disorders or preexisting motor or sensory deficits other than focal upper limb neuropathy or focal cervical radiculopathy or mild cervical myelopathy. Severe Renal disease - serum creatinine of > 2 mg/dl. Pregnant or breastfeeding patients. Unable to obtain adequate baseline SSEPs and MEPs.