For the lulz, I turned your code into one line with lambdas: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;betaveros&#x2F;1e76b3ca53001c8edcef" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;betaveros&#x2F;1e76b3ca53001c8edcef</a><p>It takes quite a few more characters, but it was fun.