More works on profiling
First complete version of profiling
merge