Implemented changes from discussion of pull request