chapter5 source code