add a debug flag to config for printing stack trace
add indent header and reindent