minor fixes
added function profiler