mid-clean2
new implementation