Electronic and optical properties of conducting polymer thin films