update chap12.py