making some modifications to cleanOut