work in progress.  hm, we need test code ...