Profiler redesign

Updated profiler script that uses functions to compute similarities.