upgrade exer_5_2.py