implements issue #29