Update and rename mainsp.py to trace.py