My earlier changes using outer() did not quite work, so I am reverting them for now.