slightly better profiler (now only prints from one central function)