added changes from pull request #26