Excellent! I wrote something almost identical to this a while back, but it was buggy and I hadn't gotten around to optimising it yet. Just always writes briliant code, so I might just need to fork Justin's code instead of fixing my own :)