begin profiling code for efficiency