reworked line deletion functionality