Patch from issue #4

see #4