finish chap7 RealWorldOCaml