First minimally-viable version.  This mostly, sort-of works for me.