added fxns to clean up output and tests