Adds the recursive function and a simple test
But something seems to be broken. Hm. I'll look at this tomorrow
with a new pair of eyes.