code to clean up .dot