imperfect but operational row removement code