Added profiling functionality