Some rough outline of the idea. There's no code yet.