implementation of issue #16