Added profiling for serial implementation