First draft of basic profiler. Not inserted everywhere yet