I like your version, I mean, I still can't implement it right now, it looks simple in words, but rewriting it into code is much more complicated and requires lengthy tests.