This is what I first thought and it's a very elegant solution, and not needlessly overcomplicated.