A lot more profiling code