Update chap6.py