Made the code that updates the tick mark highlights much more efficient, part of response to code review comments, see #3.