update on the chapter4.py program