Some changes to profiler.py