fix helper function: uppercase
[chap6] copy chap5 and add boolean support to cradle.