profile in separate file and fix multiple samples for add branch
removed profiling functions and put in separate file