make indentprint rentrant and reuse it