The original version just tried to remove all lines. In case it succeeded, it finished successfully. In case any line was missing it raised ValueError and continued in another iteration. Only number of occurrences of given lines was checked in this version.

I thought about this over night and changed the behavior in new version to take output order into account. So order of `lines` will matter in the new version. (plus added some comments)