updated phase1.py