Excellent article. I have an immediate use for this technique. However, I've spotted a minor error:

In the code annotated with a (9), you need to replace

<

with

<