Metal-insulator transition in doped polymerized polyaniline