I was thinking how painfully slow it was, until I remembered the adage: "make it work, then make it elegant, then make it fast."<p>It works, and it is certainly elegant.
I expected something like Algorithm March (<a href="http://en.wikipedia.org/wiki/Algorithm_March" rel="nofollow">http://en.wikipedia.org/wiki/Algorithm_March</a>), but this is far more... algorithmic.