added timer for profiling