adding feature requested in issue #39
Merge pull request #57 from pwfff/issue-39

fixes #39