added ch09 code