Thanks for catching this- I've updated the code and there seems to be minor performance improvements. The code is shorter and cleaner too!