Electrical and optical studies of chemically synthesized polypyrrole