That's the two loops approach, but much prettier than I thought. I like it.