Modeling two-state cooperativity in protein folding.