finished implementing trace2.py