impoved removal algorithm