Synthesis, band-gap tuning, structural and optical investigations of Mg doped ZnO nanowires