addresses several comments on pull request