Modified prob_3.py