Sort:  

Thanks social! It did take more effort than I thought but was an enjoyable exercise. Made some progress in my understanding by trying to write such a thing...