Update and enhancement  pull request #217