line insert and update implementation (together with search&update)