added timing for profiling