Properties of CdS films doped with magnesium and fluorine