made changes as outlined by pull request #4