ch6 - reusing a code, started from page 242