See the attached patch. Comments welcome. Do I miss any interesting inputs? Andreas