in progress. Issue #14, still untested and not used.
fixes #14. Needs some testing, though