Implemented output cleanup