I'll work something up in a separate commit for you to see. Easier than trying to explain in a comment :)