Synthesis of polyaniline