magnesium for cognitive function