implementation for issue #29

in need of a manual test