After some fiddling around, this seems to work.