Add profiling code