Theory of Phase Transitions in Polypeptides and