The roles of partly folded intermediates in protein folding