Add option to print the trace or not.