Added profile debug switch for profiling