The working mechanism and performance of polypyrrole as a counter electrode for dye-sensitized solar cells