Sort:  

I'll do a follow up post on how it's done. It's some really nice recursive code.