Implementing a profiler