Added first (untested) draft of the profiler.