Mechanism of hair straightening