Added profiling functions.