committed a variant of the profiler mentioned in #1