Implementation of issue #1

See issue #1