Added profiling to the demo script