Still thinking about how to do it but here is a first draft.