Optical and electrical characterization of CdS thin films