changes from pull request #42