> sort the markers by line number

Done

> use a sublist()

I had done this at first, but I wanted to avoid a duplicate list (especially as this is supposed to be an optimization).  I can easily re-add if I'm missing something.  Added a revert-able commit.